MCPcopy
hub / github.com/fastapi/full-stack-fastapi-template / DialogContent

Function DialogContent

frontend/src/components/ui/dialog.tsx:47–79  ·  view source on GitHub ↗
({
  className,
  children,
  showCloseButton = true,
  ...props
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
  showCloseButton?: boolean
})

Source from the content-addressed store, hash-verified

45}
46
47function DialogContent({
48 className,
49 children,
50 showCloseButton = true,
51 ...props
52}: React.ComponentProps<typeof DialogPrimitive.Content> & {
53 showCloseButton?: boolean
54}) {
55 return (
56 <DialogPortal data-slot="dialog-portal">
57 <DialogOverlay />
58 <DialogPrimitive.Content
59 data-slot="dialog-content"
60 className={cn(
61 "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
62 className
63 )}
64 {...props}
65 >
66 {children}
67 {showCloseButton && (
68 <DialogPrimitive.Close
69 data-slot="dialog-close"
70 className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
71 >
72 <XIcon />
73 <span className="sr-only">Close</span>
74 </DialogPrimitive.Close>
75 )}
76 </DialogPrimitive.Content>
77 </DialogPortal>
78 )
79}
80
81function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
82 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected