"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { CalendarClock } from "lucide-react";
import { Badge } from "@open-mercato/ui/primitives/badge";
function LeaveRequestPreview({
  snapshot,
  previewData,
  actionRequired,
  actionLabel
}) {
  const data = snapshot;
  const title = previewData?.title || "Leave Request";
  const subtitle = previewData?.subtitle || (data ? `${data.employeeName} - ${data.startDate} to ${data.endDate}` : "Leave Request Details");
  const status = previewData?.status || data?.status;
  const statusColor = previewData?.statusColor || "amber";
  return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 rounded-md border p-3 bg-muted/30", children: [
    /* @__PURE__ */ jsx(CalendarClock, { className: "h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0" }),
    /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
        /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: title }),
        actionRequired && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: actionLabel || "Action Required" })
      ] }),
      subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle }),
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
        status && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs", children: status }),
        data?.type && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: data.type })
      ] }),
      previewData?.metadata && Object.keys(previewData.metadata).length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-2 space-y-1", children: Object.entries(previewData.metadata).slice(0, 3).map(([key, value]) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
        /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
          key,
          ":"
        ] }),
        /* @__PURE__ */ jsx("span", { className: "truncate", children: value })
      ] }, key)) })
    ] })
  ] });
}
var LeaveRequestPreview_default = LeaveRequestPreview;
export {
  LeaveRequestPreview,
  LeaveRequestPreview_default as default
};
//# sourceMappingURL=LeaveRequestPreview.js.map
