import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r } from "../../../components/ui/accordion.js";
import { Badge as i } from "../../../components/ui/badge.js";
import { Card as a, CardContent as o } from "../../../components/ui/card.js";
import "react";
import { jsx as s, jsxs as c } from "react/jsx-runtime";
import { Code as l, FileText as u, Tag as d } from "lucide-react";
//#region src/features/documents/document-details/DocumentDetails.tsx
var f = (e) => {
	try {
		return new Date(e).toLocaleString();
	} catch {
		return e;
	}
}, p = ({ data: p }) => {
	if (!p) return null;
	let m = typeof p.schema == "string" ? p.schema : JSON.stringify(p.schema, null, 2), h = typeof p.content == "string" ? p.content : JSON.stringify(p.content, null, 2);
	return /* @__PURE__ */ s("div", {
		className: "mt-4",
		children: /* @__PURE__ */ c(e, {
			type: "multiple",
			defaultValue: [
				"document-info",
				"content",
				"schema"
			],
			className: "space-y-2",
			children: [
				/* @__PURE__ */ c(n, {
					value: "document-info",
					children: [/* @__PURE__ */ s(r, {
						className: "text-base font-semibold",
						children: /* @__PURE__ */ c("div", {
							className: "flex items-center gap-2",
							children: [/* @__PURE__ */ s(u, { className: "h-4 w-4" }), "Document Information"]
						})
					}), /* @__PURE__ */ s(t, { children: /* @__PURE__ */ c("div", {
						className: "ml-6 space-y-2",
						children: [
							/* @__PURE__ */ c("div", {
								className: "text-sm",
								children: [
									/* @__PURE__ */ s("span", {
										className: "font-medium",
										children: "ID:"
									}),
									" ",
									p.id
								]
							}),
							/* @__PURE__ */ c("div", {
								className: "text-sm",
								children: [
									/* @__PURE__ */ s("span", {
										className: "font-medium",
										children: "Name:"
									}),
									" ",
									p.name
								]
							}),
							/* @__PURE__ */ c("div", {
								className: "text-sm",
								children: [
									/* @__PURE__ */ s("span", {
										className: "font-medium",
										children: "Version:"
									}),
									" ",
									p.version
								]
							}),
							/* @__PURE__ */ c("div", {
								className: "text-sm",
								children: [
									/* @__PURE__ */ s("span", {
										className: "font-medium",
										children: "Index:"
									}),
									" ",
									p.index
								]
							}),
							/* @__PURE__ */ c("div", {
								className: "pt-2",
								children: [/* @__PURE__ */ s("div", {
									className: "mb-2 text-sm font-medium",
									children: "Labels:"
								}), /* @__PURE__ */ s("div", {
									className: "flex flex-wrap gap-2",
									children: p.labels && p.labels.length > 0 ? p.labels.map((e, t) => /* @__PURE__ */ s(i, {
										variant: "outline",
										className: "text-xs",
										children: e
									}, t)) : /* @__PURE__ */ s("span", {
										className: "text-muted-foreground text-sm",
										children: "None"
									})
								})]
							}),
							/* @__PURE__ */ c("div", {
								className: "pt-2",
								children: [/* @__PURE__ */ s("div", {
									className: "mb-2 text-sm font-medium",
									children: "Tags:"
								}), /* @__PURE__ */ s("div", {
									className: "flex flex-wrap gap-2",
									children: p.tags && p.tags.length > 0 ? p.tags.map((e, t) => /* @__PURE__ */ c(i, {
										variant: "secondary",
										className: "text-xs",
										children: [/* @__PURE__ */ s(d, { className: "mr-1 h-3 w-3" }), e]
									}, t)) : /* @__PURE__ */ s("span", {
										className: "text-muted-foreground text-sm",
										children: "None"
									})
								})]
							}),
							/* @__PURE__ */ c("div", {
								className: "space-y-1 pt-2",
								children: [/* @__PURE__ */ c("div", {
									className: "text-sm",
									children: [
										/* @__PURE__ */ s("span", {
											className: "font-medium",
											children: "Created:"
										}),
										" ",
										f(p.createdAt)
									]
								}), /* @__PURE__ */ c("div", {
									className: "text-sm",
									children: [
										/* @__PURE__ */ s("span", {
											className: "font-medium",
											children: "Updated:"
										}),
										" ",
										f(p.updatedAt)
									]
								})]
							}),
							/* @__PURE__ */ c("div", {
								className: "space-y-1 pt-2",
								children: [
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Workspace ID:"
											}),
											" ",
											p.workspaceId
										]
									}),
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Workflow ID:"
											}),
											" ",
											p.workflowId
										]
									}),
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Workflow ID:"
											}),
											" ",
											p.workflowId
										]
									})
								]
							}),
							p.meta?.mimeType && /* @__PURE__ */ c("div", {
								className: "pt-2 text-sm",
								children: [
									/* @__PURE__ */ s("span", {
										className: "font-medium",
										children: "MIME Type:"
									}),
									" ",
									p.meta.mimeType
								]
							}),
							p.meta?.enableAtPlaces && /* @__PURE__ */ c("div", {
								className: "pt-2",
								children: [/* @__PURE__ */ s("div", {
									className: "mb-2 text-sm font-medium",
									children: "Enable At Places:"
								}), /* @__PURE__ */ s("div", {
									className: "flex flex-wrap gap-2",
									children: p.meta.enableAtPlaces.map((e, t) => /* @__PURE__ */ s(i, {
										variant: "outline",
										className: "bg-blue-50 text-xs",
										children: e
									}, t))
								})]
							}),
							p.meta && Object.entries(p.meta).filter(([e]) => !["mimeType", "enableAtPlaces"].includes(e)).map(([e, t]) => /* @__PURE__ */ c("div", {
								className: "text-sm",
								children: [
									/* @__PURE__ */ c("span", {
										className: "font-medium",
										children: [e, ":"]
									}),
									" ",
									typeof t == "object" ? JSON.stringify(t) : String(t)
								]
							}, e)),
							/* @__PURE__ */ c("div", {
								className: "space-y-1 pt-2",
								children: [
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Invalidated:"
											}),
											" ",
											p.isInvalidated ? "Yes" : "No"
										]
									}),
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Pending Removal:"
											}),
											" ",
											p.isPendingRemoval ? "Yes" : "No"
										]
									}),
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Transition:"
											}),
											" ",
											p.transition
										]
									}),
									/* @__PURE__ */ c("div", {
										className: "text-sm",
										children: [
											/* @__PURE__ */ s("span", {
												className: "font-medium",
												children: "Place:"
											}),
											" ",
											p.place
										]
									})
								]
							})
						]
					}) })]
				}),
				/* @__PURE__ */ c(n, {
					value: "content",
					children: [/* @__PURE__ */ s(r, {
						className: "text-base font-semibold",
						children: /* @__PURE__ */ c("div", {
							className: "flex items-center gap-2",
							children: [/* @__PURE__ */ s(u, { className: "h-4 w-4" }), "Content"]
						})
					}), /* @__PURE__ */ s(t, { children: /* @__PURE__ */ s(a, {
						className: "bg-gray-50",
						children: /* @__PURE__ */ s(o, {
							className: "p-4",
							children: /* @__PURE__ */ s("pre", {
								className: `max-h-96 overflow-auto rounded bg-gray-100 p-2 text-xs wrap-break-word whitespace-pre-wrap ${p.meta?.mimeType === "text/markdown" ? "font-sans" : "font-mono"}`,
								children: h
							})
						})
					}) })]
				}),
				/* @__PURE__ */ c(n, {
					value: "schema",
					children: [/* @__PURE__ */ s(r, {
						className: "text-base font-semibold",
						children: /* @__PURE__ */ c("div", {
							className: "flex items-center gap-2",
							children: [/* @__PURE__ */ s(l, { className: "h-4 w-4" }), "Schema"]
						})
					}), /* @__PURE__ */ s(t, { children: /* @__PURE__ */ s(a, {
						className: "bg-gray-50",
						children: /* @__PURE__ */ s(o, {
							className: "p-4",
							children: /* @__PURE__ */ s("pre", {
								className: "rounded bg-gray-100 p-2 font-mono text-xs wrap-break-word whitespace-pre-wrap",
								children: m
							})
						})
					}) })]
				})
			]
		})
	});
};
//#endregion
export { p as default };
