import classNames from "classnames"; import { CSSProperties, ReactNode } from "react"; import { createPortal } from "react-dom"; import IconButton from "@/Components/Button/IconButton"; export default function Flyout({ show, children, title, actions, onClose, side, width, }: { show: boolean; title?: ReactNode; actions?: ReactNode; children?: ReactNode; onClose: () => void; side: "left" | "right"; width?: string; }) { const styles = { "--flyout-w": width ?? "400px", transition: "all 0.2s ease-in-out", width: "var(--flyout-w)", transform: side === "right" ? `translate(${show ? "0" : "var(--flyout-w)"},0)` : `translate(${show ? "0" : "calc(-1 * var(--flyout-w))"},0)`, } as CSSProperties; return createPortal(