"use client"; import { useRef, type ReactNode } from "react"; import { Ellipsis, X } from "lucide-react"; import { Button } from "@/components/ui/button"; /** * Button that opens a side dialog (native ) with content rendered on the server. * Default trigger is "⋯" (page settings); pass `trigger` for a labelled button such as "+ Стори". */ export function SettingsDialog({ title, trigger, children }: { title: string; trigger?: ReactNode; children: ReactNode }) { const ref = useRef(null); const open = () => ref.current?.showModal(); return ( <> {trigger ? ( ) : ( )} e.target === ref.current && ref.current.close()} className="m-0 ml-auto h-dvh max-h-dvh w-[400px] max-w-full border-l bg-sidebar p-0 text-foreground backdrop:bg-black/50" >

{title}

{children}
); }