import { Fragment, ReactNode, useState } from "react"; import { Dialog, Menu, Transition } from "@headlessui/react"; import XIcon from "../icons/XIcon"; import clsx from "clsx"; import DotsVerticalFilledIcon from "../icons/DotsVerticalFilledIcon"; import Link from "next/link"; interface Props { title: string; description: string; children: ReactNode; onClosed: () => void; className?: string; classNameBg?: string; options?: { title: string; onClick?: () => void; onClickRoute?: string; }[]; } export default function SlideOverFormLayout({ title, description, children, onClosed, className = "max-w-lg", classNameBg = "bg-white", options }: Props) { const [open, setOpen] = useState(true); function onClose() { setOpen(false); onClosed(); } return (
{/* Header */}
{title}

{description}

{options && options.length > 0 && (
Open options
{options.map((item, idx) => { return ( {({ active }) => ( <> {item.onClick && ( )} {item.onClickRoute && ( Previous conversations )} )} ); })}
)}
{children}
); }