2025-12-07 19:32:53 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo';
|
2026-02-01 18:29:34 +02:00
|
|
|
import { useThemeSystem } from '@/contexts/useThemeSystem';
|
2026-04-07 01:17:12 +03:00
|
|
|
import { useGlobalSyncStore } from '@/sync/global-sync-store';
|
2025-12-21 22:59:06 +02:00
|
|
|
|
2026-03-20 01:01:03 +02:00
|
|
|
const ChatEmptyState: React.FC = () => {
|
2026-02-01 18:29:34 +02:00
|
|
|
const { currentTheme } = useThemeSystem();
|
2026-04-07 01:17:12 +03:00
|
|
|
const initError = useGlobalSyncStore((s) => s.error);
|
2025-12-21 22:59:06 +02:00
|
|
|
|
2026-02-01 18:29:34 +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">
|
2026-04-03 16:44:31 +03:00
|
|
|
<OpenChamberLogo width={140} height={140} className="opacity-20" />
|
2026-04-07 01:17:12 +03:00
|
|
|
{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">OpenCode is not reachable</span>
|
|
|
|
|
<span className="text-body-sm" style={{ color: textColor }}>
|
|
|
|
|
{initError.message}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<span className="text-body-md" style={{ color: textColor }}>Start a new chat</span>
|
|
|
|
|
)}
|
2025-12-07 19:32:53 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default React.memo(ChatEmptyState);
|