"use client"; import { ReactElement, ReactNode } from "react"; import { Button } from "@/components/ui/button"; import { RiCloseFill } from "react-icons/ri"; import { Avatar, AvatarImage, AvatarFallback } from "@radix-ui/react-avatar"; import { useRouter } from "next/navigation"; import { getTagAllValues, getTagValues } from "@/lib/nostr/utils"; import useProfile from "@/lib/hooks/useProfile"; import { nip19 } from "nostr-tools"; import { getNameToShow, getTwoLetters } from "@/lib/utils"; export default function Layout(props: { children: ReactElement; params: { key: string }; }) { const router = useRouter(); const { data, type } = nip19.decode(props.params.key); const pubkey = type === "nevent" ? data.author ?? "" : ""; const { profile } = useProfile(pubkey); const npub = nip19.npubEncode(pubkey); return (