UNPKG

@premieroctet/next-admin

Version:

Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje

38 lines (37 loc) 1.56 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { AdjustmentsHorizontalIcon } from "@heroicons/react/24/outline"; import { useState } from "react"; import useAdvancedSearch_mjs_default from "../../hooks/useAdvancedSearch.mjs"; import Button_mjs_default from "../radix/Button.mjs"; import external_AdvancedSearchModal_mjs_default from "./AdvancedSearchModal.mjs"; const AdvancedSearchButton_AdvancedSearchButton = ({ resource, schema })=>{ const [modalOpen, setModalOpen] = useState(false); const { uiBlocks } = useAdvancedSearch_mjs_default({ resource, schema }); return /*#__PURE__*/ jsxs("div", { className: "relative", children: [ !!uiBlocks?.length && /*#__PURE__*/ jsx("span", { className: "bg-nextadmin-brand-default absolute right-0 top-0 h-2 w-2 rounded-full" }), /*#__PURE__*/ jsx(Button_mjs_default, { variant: "ghost", className: "px-2", onClick: ()=>setModalOpen(true), children: /*#__PURE__*/ jsx(AdjustmentsHorizontalIcon, { className: "h-6 w-6" }) }), /*#__PURE__*/ jsx(external_AdvancedSearchModal_mjs_default, { isOpen: modalOpen, onClose: ()=>setModalOpen(false), resource: resource, schema: schema }) ] }); }; const AdvancedSearchButton = AdvancedSearchButton_AdvancedSearchButton; export { AdvancedSearchButton as default };