"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
function DefaultValueDisplay({ featureToggleItem }) {
  const t = useT();
  const defaultValue = featureToggleItem?.defaultValue;
  if (defaultValue === null || defaultValue === void 0) {
    return /* @__PURE__ */ jsx("p", { className: "text-base text-muted-foreground", children: "-" });
  }
  switch (featureToggleItem?.type) {
    case "boolean":
      return /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: defaultValue ? t("feature_toggles.values.true", "True") : t("feature_toggles.values.false", "False") });
    case "string":
      return /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: defaultValue });
    case "number":
      return /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: defaultValue });
    case "json":
      return /* @__PURE__ */ jsx("div", { className: "text-base font-semibold text-foreground", children: /* @__PURE__ */ jsx("pre", { className: "bg-muted/30 p-2 rounded text-sm font-mono overflow-x-auto whitespace-pre-wrap", children: typeof defaultValue === "object" ? JSON.stringify(defaultValue, null, 2) : defaultValue }) });
    default:
      return /* @__PURE__ */ jsx("p", { className: "text-base text-muted-foreground", children: "-" });
  }
}
function FeatureToggleDetailsCard({ featureToggleItem }) {
  const t = useT();
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
    /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
      /* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("feature_toggles.detail.details", "Details") }),
      /* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("feature_toggles.detail.fields.name", "Name") }),
          /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: featureToggleItem?.name ?? "-" })
        ] }),
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("feature_toggles.detail.fields.identifier", "Identifier") }),
          /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: featureToggleItem?.identifier ?? "-" })
        ] }),
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("feature_toggles.detail.fields.category", "Category") }),
          /* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: featureToggleItem?.category ?? "-" })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
      /* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("feature_toggles.detail.description", "Description") }),
      /* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: featureToggleItem?.description ?? "-" })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
      /* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("feature_toggles.detail.defaultValue", "Default Value") }),
      /* @__PURE__ */ jsx(DefaultValueDisplay, { featureToggleItem })
    ] })
  ] });
}
export {
  FeatureToggleDetailsCard
};
//# sourceMappingURL=FeatureToggleDetailsCard.js.map
