import RelayIcon from '@/components/RelayIcon' import { DropdownMenuItem } from '@/components/ui/dropdown-menu' import { useSeenOnRelays } from '@/hooks/useSeenOnRelays' import { getKindDescription } from '@/lib/kind-description' import { toRelay } from '@/lib/link' import { simplifyUrl } from '@/lib/url' import { useSecondaryPage } from '@/PageManager' import type { Event } from 'nostr-tools' import { useTranslation } from 'react-i18next' export default function NoteOptionsMetaHeader({ event, allowedRelays, onNavigate, inDropdown = false }: { event: Event allowedRelays?: readonly string[] onNavigate?: () => void inDropdown?: boolean }) { const { t } = useTranslation() const { push } = useSecondaryPage() const relays = useSeenOnRelays(event.id, allowedRelays) const { description } = getKindDescription(event.kind, event) const relayRows = relays.map((relay) => { const label = ( <> {simplifyUrl(relay)} ) if (inDropdown) { return ( { onNavigate?.() push(toRelay(relay)) }} > {label} ) } return (
  • ) }) return (

    {t('Note kind label line', { kind: event.kind, description })}

    {relays.length > 0 ? (

    {t('Seen on')}

    {inDropdown ? (
    {relayRows}
    ) : (
      {relayRows}
    )}
    ) : null}
    ) }