diff --git a/components/list/ListUI.tsx b/components/list/ListUI.tsx index ab92d9d..8298066 100644 --- a/components/list/ListUI.tsx +++ b/components/list/ListUI.tsx @@ -51,11 +51,15 @@ export const ListUI: React.FC = ({
-
- {typeof title === "function" - ? title({ ui: local, count: local.count }) - : title} -
+ {title ? ( +
+ {typeof title === "function" + ? title({ ui: local, count: local.count }) + : title} +
+ ) : ( + <> + )}
, - VariantProps {} + VariantProps { + showClose?: boolean; +} const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps ->(({ side = "right", className, children, ...props }, ref) => ( - - - - - - Close - - {children} - - -)); +>( + ( + { side = "right", showClose = true, className, children, ...props }, + ref + ) => ( + + + + {showClose && ( // Hanya render tombol close jika showClose true + + + Close + + )} + {children} + + + ) +); SheetContent.displayName = SheetPrimitive.Content.displayName; const SheetHeader = ({ @@ -126,23 +135,47 @@ const SheetDescription = React.forwardRef< )); export interface SheetBetterProps { open?: boolean; + contentOpen?: any; + onOpenChange?: (open: boolean) => void; + showClose?: boolean; + side?: "top" | "bottom" | "left" | "right"; } const SheetBetter = ({ className, + open, + contentOpen, + showClose = true, + side = "right", + onOpenChange, + children, ...props }: SheetBetterProps & React.HTMLAttributes) => { + const [isOpen, setOpen] = React.useState(false as boolean); return ( - - Open - - + { + setOpen(event); + if (typeof onOpenChange === "function") { + onOpenChange(event); + } + }} + > + setOpen(true)}>{contentOpen} + + Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. + {children} );