Files
openchamber/packages/ui/src/components/chat/ChatEmptyState.tsx
T

32 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-12-07 19:32:53 +02:00
import React from 'react';
import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo';
import { useThemeSystem } from '@/contexts/useThemeSystem';
import { useGlobalSyncStore } from '@/sync/global-sync-store';
import { useI18n } from '@/lib/i18n';
2025-12-21 22:59:06 +02:00
const ChatEmptyState: React.FC = () => {
const { t } = useI18n();
const { currentTheme } = useThemeSystem();
const initError = useGlobalSyncStore((s) => s.error);
2025-12-21 22:59:06 +02:00
const textColor = currentTheme?.colors?.surface?.mutedForeground || 'var(--muted-foreground)';
2025-12-21 22:59:06 +02:00
2025-12-07 19:32:53 +02:00
return (
2025-12-21 22:59:06 +02:00
<div className="flex flex-col items-center justify-center min-h-full w-full gap-6">
<OpenChamberLogo width={140} height={140} className="opacity-20" />
{initError ? (
<div className="flex flex-col items-center gap-2 max-w-md text-center px-4">
<span className="text-body-md font-medium text-destructive">{t('chat.emptyState.opencodeUnreachable')}</span>
<span className="text-body-sm" style={{ color: textColor }}>
{initError.message}
</span>
</div>
) : (
<span className="text-body-md" style={{ color: textColor }}>{t('chat.emptyState.startNewChat')}</span>
)}
2025-12-07 19:32:53 +02:00
</div>
);
};
export default React.memo(ChatEmptyState);