initial
This commit is contained in:
35
apps/web/src/pages/Home.tsx
Normal file
35
apps/web/src/pages/Home.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { AddProjectModal } from '@/components/AddProjectModal';
|
||||
import { useProjects } from '@/hooks/useProjects';
|
||||
|
||||
export function Home() {
|
||||
const { projects, refresh } = useProjects();
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const empty = projects && projects.length === 0;
|
||||
|
||||
return (
|
||||
<div className="flex-1 flex items-center justify-center px-6">
|
||||
<div className="max-w-md text-center space-y-4">
|
||||
{empty ? (
|
||||
<>
|
||||
<h1 className="text-2xl font-semibold tracking-tight">No projects yet</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Add a project from /opt to start chatting about its code.
|
||||
</p>
|
||||
<Button onClick={() => setOpen(true)}>Add project</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<h1 className="text-2xl font-semibold tracking-tight">BooCode</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Pick a project from the sidebar.
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<AddProjectModal open={open} onOpenChange={setOpen} onAdded={refresh} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user