UNPKG

pagamio-frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

11 lines (10 loc) 1.09 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Drawer } from 'flowbite-react'; const BaseDrawer = ({ title, isOpen, marginTop = '0px', onClose, children }) => { return (_jsxs(Drawer, { open: isOpen, onClose: onClose, backdrop: false, position: "right", className: "flex flex-col px-0 bg-customGray-5 border-l-2 border-gray-100 w-full md:w-[420px]", style: { marginTop, height: `calc(100vh - ${marginTop})`, paddingTop: '0px', }, children: [_jsxs("div", { className: "sticky top-0 flex items-center h-12 border-b", style: { zIndex: 100 }, children: [_jsx("div", { className: "flex items-center justify-start pl-6 h-full bg-customGray-25 py-5", style: { width: '88%' }, children: _jsx("h2", { className: "text-lg font-semibold text-black truncate", children: title }) }), _jsx("button", { type: "button", className: "hover:text-gray-500 hover:bg-customGray-15", onClick: onClose, style: { width: '12%', backgroundColor: 'white', height: '3rem' }, children: "x" })] }), children] })); }; export default BaseDrawer;