UNPKG

autumn-js

Version:

Autumn JS Library

50 lines (46 loc) 1.6 kB
"use client"; import { getCheckContent } from "./chunk-MY2ODATB.mjs"; import { Button } from "./chunk-EV5RNY5U.mjs"; import { Dialog, DialogContent, DialogFooter, DialogTitle } from "./chunk-JPLUWGH4.mjs"; import { cn } from "./chunk-4J6OC4ZQ.mjs"; // src/libraries/react/components/check-dialog/check-dialog-synced.tsx import { useState } from "react"; import { Fragment, jsx, jsxs } from "react/jsx-runtime"; function CheckDialog(params) { const [loading] = useState(false); if (!params || !params.preview) { return /* @__PURE__ */ jsx(Fragment, {}); } const { open, setOpen } = params; const { products } = params.preview; const { title, message } = getCheckContent(params.preview); return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-overflow-hidden au-text-sm", children: [ /* @__PURE__ */ jsx(DialogTitle, { className: cn("au-font-bold au-text-xl au-px-6"), children: title }), /* @__PURE__ */ jsx("div", { className: "au-px-6 au-my-2", children: message }), /* @__PURE__ */ jsx(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-mt-4 au-pl-6 au-pr-3 au-bg-secondary au-border-t", children: /* @__PURE__ */ jsx( Button, { size: "sm", className: "au-font-medium au-shadow au-transition au-min-w-20", onClick: async () => { setOpen(false); }, children: "Confirm" } ) }) ] }) }); } export { CheckDialog };