EmbeddedWebsocketUrl.tsx raw

   1  import { useSecondaryPage } from '@/PageManager'
   2  import { toRelay } from '@/lib/link'
   3  
   4  export function EmbeddedWebsocketUrl({ url }: { url: string }) {
   5    const { push } = useSecondaryPage()
   6    return (
   7      <span
   8        className="cursor-pointer px-1 text-primary hover:bg-primary/20"
   9        onClick={(e) => {
  10          e.stopPropagation()
  11          push(toRelay(url))
  12        }}
  13      >
  14        [ {url} ]
  15        <span className="w-2 h-1 bg-primary" />
  16      </span>
  17    )
  18  }
  19