Files
openchamber/packages/ui/src/components/sections/SectionPlaceholder.tsx
T
Bohdan Triapitsyn 7d7285655d Add i18n foundation and translations (#1027)
* feat: add i18n foundation

* feat: localize sessions sidebar

* Localize multirun/scheduled tasks and fix dialog dropdown interactions

* localize git sidebar surface and add zh-CN keys

* feat(ui): localize context panel, diff/plan views, and context sidebar content

* fix(config): resolve user config home via fs/home before embedded home

* localize header/chat UI and complete model/worktree panel strings

* localize worktree + github issue/pr dialog flows

* localize settings sections and split settings i18n dictionaries

* localize additional settings sections and sidebars

* localize more settings pages and dialogs

* fix settings select trigger localization

* localize tunnel settings ui surface

* localize additional settings sections

* localize keyboard shortcuts labels in settings

* localize terminal and utility dialogs surfaces

* feat(i18n): localize remaining UI strings

* Add Ukrainian locale

* Add Spanish locale

* Add Brazilian Portuguese locale

* Polish locale translations
2026-04-26 14:03:39 +03:00

45 lines
1.8 KiB
TypeScript

import React from 'react';
import { SIDEBAR_SECTION_CONFIG_MAP, SIDEBAR_SECTION_DESCRIPTIONS } from '@/constants/sidebar';
import type { SidebarSection } from '@/constants/sidebar';
import { useI18n } from '@/lib/i18n';
interface SectionPlaceholderProps {
sectionId: SidebarSection;
variant: 'sidebar' | 'page';
}
export const SectionPlaceholder: React.FC<SectionPlaceholderProps> = ({ sectionId, variant }) => {
const { t } = useI18n();
const config = SIDEBAR_SECTION_CONFIG_MAP[sectionId];
const Icon = config.icon;
if (variant === 'sidebar') {
return (
<div className="flex h-full flex-col items-center justify-center gap-3 px-6 text-center">
<div className="rounded-full bg-accent/40 p-3 text-muted-foreground">
<Icon className="h-5 w-5" />
</div>
<h3 className="typography-ui-label font-semibold text-foreground">{config.label}</h3>
<p className="typography-meta max-w-xs text-muted-foreground">
{SIDEBAR_SECTION_DESCRIPTIONS[sectionId]}
</p>
</div>
);
}
return (
<div className="flex h-full flex-col items-center justify-center gap-4 px-6 text-center">
<div className="rounded-full bg-accent/40 p-4 text-muted-foreground">
<Icon className="h-8 w-8" />
</div>
<div className="flex flex-col gap-2">
<h2 className="typography-h2 font-semibold text-foreground">{config.label}</h2>
<p className="typography-body max-w-md text-muted-foreground">
{SIDEBAR_SECTION_DESCRIPTIONS[sectionId]}
</p>
</div>
<p className="typography-meta text-muted-foreground/60">{t('settings.common.state.comingSoon')}</p>
</div>
);
};