import { jsx, jsxs } from "react/jsx-runtime";
import { Page, PageBody } from "@open-mercato/ui/backend/Page";
import { Alert, AlertDescription, AlertTitle } from "@open-mercato/ui/primitives/alert";
import { resolveTranslations } from "@open-mercato/shared/lib/i18n/server";
import { parseBooleanWithDefault } from "@open-mercato/shared/lib/boolean";
import { AttachmentPartitionSettings } from "../../../components/AttachmentPartitionSettings.js";
import { isPartitionSettingsLocked } from "../../../lib/partitions.js";
async function AttachmentsConfigurationPage() {
  const partitionsLocked = isPartitionSettingsLocked();
  const s3Enabled = parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false);
  const { t } = await resolveTranslations();
  const lockedTitle = t("attachments.partitions.locked.title", "Partition settings locked");
  const lockedDescription = t(
    "attachments.partitions.locked.description",
    "Attachment partitions are managed by environment defaults while demo or onboarding mode is enabled."
  );
  const lockedHint = t(
    "attachments.partitions.locked.hint",
    "Update the environment variables below to re-enable in-app configuration."
  );
  return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs(PageBody, { className: "space-y-6", children: [
    partitionsLocked ? /* @__PURE__ */ jsxs(Alert, { variant: "warning", children: [
      /* @__PURE__ */ jsx(AlertTitle, { children: lockedTitle }),
      /* @__PURE__ */ jsxs(AlertDescription, { children: [
        lockedDescription,
        " ",
        lockedHint,
        " ",
        /* @__PURE__ */ jsx("code", { children: "DEMO_MODE" }),
        " / ",
        /* @__PURE__ */ jsx("code", { children: "SELF_SERVICE_ONBOARDING_ENABLED" }),
        "."
      ] })
    ] }) : null,
    !partitionsLocked ? /* @__PURE__ */ jsx(AttachmentPartitionSettings, { s3Enabled }) : null
  ] }) });
}
export {
  AttachmentsConfigurationPage as default
};
//# sourceMappingURL=page.js.map
