2024-09-26 16:45:41 +00:00
|
|
|
import { json, type MetaFunction } from '@remix-run/cloudflare';
|
2024-07-10 16:44:39 +00:00
|
|
|
import { ClientOnly } from 'remix-utils/client-only';
|
2024-07-24 15:43:32 +00:00
|
|
|
import { BaseChat } from '~/components/chat/BaseChat';
|
|
|
|
import { Chat } from '~/components/chat/Chat.client';
|
2024-07-26 14:08:24 +00:00
|
|
|
import { Header } from '~/components/header/Header';
|
2024-11-14 12:20:00 +00:00
|
|
|
import BackgroundRays from '~/components/ui/BackgroundRays';
|
2025-02-02 00:42:30 +00:00
|
|
|
import { ControlPanel } from '~/components/@settings';
|
|
|
|
import { SettingsButton } from '~/components/ui/SettingsButton';
|
2025-02-01 17:01:34 +00:00
|
|
|
import { useState } from 'react';
|
2024-07-10 16:44:39 +00:00
|
|
|
|
|
|
|
export const meta: MetaFunction = () => {
|
|
|
|
return [{ title: 'Bolt' }, { name: 'description', content: 'Talk with Bolt, an AI assistant from StackBlitz' }];
|
|
|
|
};
|
|
|
|
|
2024-09-26 16:45:41 +00:00
|
|
|
export const loader = () => json({});
|
2024-07-11 19:25:19 +00:00
|
|
|
|
2024-07-10 16:44:39 +00:00
|
|
|
export default function Index() {
|
2025-02-01 17:01:34 +00:00
|
|
|
const [showControlPanel, setShowControlPanel] = useState(false);
|
|
|
|
|
2024-07-10 16:44:39 +00:00
|
|
|
return (
|
2024-11-20 19:51:39 +00:00
|
|
|
<div className="flex flex-col h-full w-full bg-bolt-elements-background-depth-1">
|
2024-11-14 12:20:00 +00:00
|
|
|
<BackgroundRays />
|
2024-07-10 16:44:39 +00:00
|
|
|
<Header />
|
|
|
|
<ClientOnly fallback={<BaseChat />}>{() => <Chat />}</ClientOnly>
|
2025-02-02 00:42:30 +00:00
|
|
|
<div className="fixed bottom-4 right-4">
|
|
|
|
<SettingsButton onClick={() => setShowControlPanel(true)} />
|
|
|
|
</div>
|
2025-02-01 17:01:34 +00:00
|
|
|
<ClientOnly>
|
|
|
|
{() => <ControlPanel open={showControlPanel} onClose={() => setShowControlPanel(false)} />}
|
|
|
|
</ClientOnly>
|
2024-07-10 16:44:39 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|