RawEventDialog.tsx raw

   1  import {
   2    Dialog,
   3    DialogContent,
   4    DialogDescription,
   5    DialogHeader,
   6    DialogTitle
   7  } from '@/components/ui/dialog'
   8  import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'
   9  import { Event } from 'nostr-tools'
  10  
  11  export default function RawEventDialog({
  12    event,
  13    isOpen,
  14    onClose
  15  }: {
  16    event: Event
  17    isOpen: boolean
  18    onClose: () => void
  19  }) {
  20    return (
  21      <Dialog open={isOpen} onOpenChange={onClose}>
  22        <DialogContent className="h-[60vh]">
  23          <DialogHeader>
  24            <DialogTitle>Raw Event</DialogTitle>
  25            <DialogDescription className="hidden" />
  26          </DialogHeader>
  27          <ScrollArea className="h-full">
  28            <pre className="text-sm text-muted-foreground select-text">
  29              {JSON.stringify(event, null, 2)}
  30            </pre>
  31            <ScrollBar orientation="horizontal" />
  32          </ScrollArea>
  33        </DialogContent>
  34      </Dialog>
  35    )
  36  }
  37