@ducor/react
Version:
admin template ui interface
28 lines (27 loc) • 1.37 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from "react";
import Flex from "./flex";
import Button from "./button";
import Dropdown from "./dropdown";
var DevWidget = function (_a) {
var children = _a.children;
return _jsx("div", { className: 'relative w-full border p-2 my-5', children: children });
};
var Header = function (_a) {
var children = _a.children;
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
return (_jsx("div", { className: 'absolute right-1 -top-5 z-10', children: _jsxs(Dropdown, { className: 'flex gap-2', children: [_jsx(Dropdown.Toggle, { children: _jsx(Button, { onClick: function () { return setIsOpen(true); }, size: 'sm', variant: 'gray', className: 'rounded-full px-2', children: _jsx("i", { className: 'feather-feather ' }) }) }), _jsx(Dropdown.Menu, { className: 'right-0 top-8 ', children: isOpen ? _jsx("div", { className: 'flex gap-1 p-1 ', children: children }) : null })] }) }));
};
var Body = function (_a) {
var children = _a.children;
return _jsx("div", { className: 'block', children: children });
};
var Footer = function (_a) {
var children = _a.children;
return (_jsx(Flex, { justify: 'center', align: 'center', children: children }));
};
export default Object.assign(DevWidget, {
Header: Header,
Body: Body,
Footer: Footer,
});