Files
buzz-sheet/components/admin/guide-section-editor.tsx
T
gunshiz 9580407a90
CI / Verify (push) Successful in 1m56s
CI / Build immutable images and deploy (push) Successful in 3m12s
perf : cache
2026-10-08 23:21:34 +07:00

28 lines
1.5 KiB
TypeScript

"use client";
import dynamic from "next/dynamic";
import { Skeleton } from "@/components/ui/skeleton";
import type { GuideSectionEditorProps } from "./editors/shared";
function EditorLoading() {
return <Skeleton className="h-64 w-full" aria-label="Loading editor" />;
}
const WeaponEditor = dynamic(() => import("./editors/weapon-editor").then((module) => module.WeaponEditor), { loading: EditorLoading });
const ArtifactEditor = dynamic(() => import("./editors/artifact-editor").then((module) => module.ArtifactEditor), { loading: EditorLoading });
const ConstellationEditor = dynamic(() => import("./editors/constellation-editor").then((module) => module.ConstellationEditor), { loading: EditorLoading });
const TeamEditor = dynamic(() => import("./editors/team-editor").then((module) => module.TeamEditor), { loading: EditorLoading });
const ExtraEditor = dynamic(() => import("./editors/extra-editor").then((module) => module.ExtraEditor), { loading: EditorLoading });
export function GuideSectionEditor(props: GuideSectionEditorProps) {
return (
<div className="flex flex-col gap-6">
{props.section === "weapon" ? <WeaponEditor {...props} /> : null}
{props.section === "artifact" ? <ArtifactEditor {...props} /> : null}
{props.section === "constellations" ? <ConstellationEditor {...props} /> : null}
{props.section === "team" ? <TeamEditor {...props} /> : null}
{props.section === "extra" ? <ExtraEditor {...props} /> : null}
</div>
);
}