Adds client-side i18n support, language settings, translated UI copy, and locale parity coverage.
31 lines
835 B
TypeScript
31 lines
835 B
TypeScript
import type { ComponentType } from "react";
|
|
import { i18n } from "@/i18n/i18next";
|
|
import type { PanelDescriptor, PanelIconProps } from "@/panels/panel-registry";
|
|
|
|
export function buildDraftPanelDescriptor(input: {
|
|
isCreating: boolean;
|
|
pendingPrompt?: string | null;
|
|
icon: ComponentType<PanelIconProps>;
|
|
}): PanelDescriptor {
|
|
const { icon, isCreating, pendingPrompt } = input;
|
|
const newAgentLabel = i18n.t("panels.draft.newAgent");
|
|
const creatingLabel = pendingPrompt?.trim() || newAgentLabel;
|
|
if (isCreating) {
|
|
return {
|
|
label: creatingLabel,
|
|
subtitle: i18n.t("panels.draft.creatingAgent"),
|
|
titleState: "ready",
|
|
icon,
|
|
statusBucket: "running",
|
|
};
|
|
}
|
|
|
|
return {
|
|
label: newAgentLabel,
|
|
subtitle: newAgentLabel,
|
|
titleState: "ready",
|
|
icon,
|
|
statusBucket: null,
|
|
};
|
|
}
|