Files
EpicNext-Cms/src/components/admin/studio/organize-imports-launcher.tsx
T
openhands 56676effc3
CI / check (push) Failing after 43s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped
feat(studio): localize catalog studio UI and polish responsive layout
Route all Catalog Studio strings through the admin.studio namespace
(workspace, filters, review, inspector, quality, sync, scale32, organize
imports and page titles/subtitles) with English fallback, and add shared
StudioPage chrome plus a loading skeleton. Tighten mobile padding on the
header and sub-bars.
2026-10-13 20:31:26 +02:00

43 lines
1.1 KiB
TypeScript

"use client";
import { FolderTree } from "lucide-react";
import { useTranslations } from "next-intl";
import { lazy, Suspense, useState } from "react";
import { StudioPanelLoading } from "./studio-panel-loading";
const OrganizeImportsDialog = lazy(() =>
import("./organize-imports-dialog").then((module) => ({
default: module.OrganizeImportsDialog,
})),
);
export function OrganizeImportsLauncher() {
const t = useTranslations("pages.admin.catalog.workspace.organizeImports");
const [open, setOpen] = useState(false);
const [requested, setRequested] = useState(false);
return (
<>
<button
type="button"
onClick={() => {
setRequested(true);
setOpen(true);
}}
className="flex min-h-10 items-center gap-2 rounded-lg px-3 text-sm font-medium text-[var(--admin-text-muted)] hover:bg-[var(--admin-accent)]/10"
>
<FolderTree size={16} />
{t("title")}
</button>
{requested && (
<Suspense
fallback={
open ? <StudioPanelLoading onClose={() => setOpen(false)} /> : null
}
>
<OrganizeImportsDialog open={open} onOpenChange={setOpen} />
</Suspense>
)}
</>
);
}