cc-haha/desktop/src/components/tasks/TaskEmptyState.tsx
程序员阿江(Relakkes) a2bf92079b feat: add i18n support with English and Chinese locales
Add a lightweight custom i18n system supporting English (default)
and Chinese, with a language switcher in Settings > General.
All 35+ UI components internationalized with ~270 translation keys,
including 189 Chinese spinner verbs and server error code mapping.
2026-04-07 22:18:16 +08:00

31 lines
1.0 KiB
TypeScript

import { Button } from '../shared/Button'
import { useTranslation } from '../../i18n'
type Props = {
onCreateTask: () => void
}
export function TaskEmptyState({ onCreateTask }: Props) {
const t = useTranslation()
return (
<div className="flex flex-col items-center justify-center py-20">
{/* Clock icon */}
<div className="w-16 h-16 rounded-full bg-[var(--color-surface-info)] flex items-center justify-center mb-4">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="var(--color-text-tertiary)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<circle cx="12" cy="12" r="10" />
<polyline points="12 6 12 12 16 14" />
</svg>
</div>
<h3 className="text-sm font-medium text-[var(--color-text-primary)] mb-1">
{t('tasks.emptyTitle')}
</h3>
<p className="text-sm text-[var(--color-text-tertiary)] mb-4 text-center max-w-sm">
{t('tasks.emptyDesc')}
</p>
<Button onClick={onCreateTask}>{t('tasks.newTask')}</Button>
</div>
)
}