import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog' import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@/components/ui/drawer' import { useScreenSize } from '@/providers/ScreenSizeProvider' import { QrCodeIcon } from 'lucide-react' import { nip19 } from 'nostr-tools' import { useMemo } from 'react' import Nip05 from '../Nip05' import PubkeyCopy from '../PubkeyCopy' import QrCode from '../QrCode' import UserAvatar from '../UserAvatar' import Username from '../Username' export default function NpubQrCode({ pubkey }: { pubkey: string }) { const { isSmallScreen } = useScreenSize() const npub = useMemo(() => (pubkey ? nip19.npubEncode(pubkey) : ''), [pubkey]) if (!npub) return null const trigger = (
) const content = (
) if (isSmallScreen) { return ( {trigger} Profile QR Code {content} ) } return ( {trigger} e.preventDefault()}> Profile QR Code Share your Nostr profile with a QR code {content} ) }