"use client"; import { ReactNode } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { X } from "lucide-react"; interface DrawerProps { isOpen: boolean; onClose: () => void; children: ReactNode; side?: "left" | "right"; width?: string; } export default function Drawer({ isOpen, onClose, children, side = "left", width = "max-w-[420px]", }: DrawerProps) { const slideAnimation = { initial: { x: side === "left" ? "-100%" : "100%" }, animate: { x: 0 }, exit: { x: side === "left" ? "-100%" : "100%" }, }; return ( {isOpen && ( <>
{children}
)}
); }