Files
paseo/packages/app/src/panels/draft-panel-descriptor.ts
T
chyendongnhanh338andGitHub 08ebe5e7e1 Complete client UI i18n migration
Adds client-side i18n support, language settings, translated UI copy, and locale parity coverage.
2026-06-11 14:15:35 +08:00

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,
};
}