mirror of
https://github.com/harivansh-afk/RAG-ui.git
synced 2026-04-17 16:02:41 +00:00
Working frontend interface with supabse storage
This commit is contained in:
parent
ae239a2849
commit
1eb339623c
19 changed files with 1150 additions and 422 deletions
|
|
@ -2,8 +2,15 @@ import React from 'react';
|
|||
import { BookOpen } from 'lucide-react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Button } from '../../ui/Button';
|
||||
import { useAuth } from '../../../contexts/AuthContext';
|
||||
|
||||
const Header = () => {
|
||||
const { session, signOut } = useAuth();
|
||||
|
||||
const handleSignOut = async () => {
|
||||
await signOut();
|
||||
};
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
<header className="border-b bg-background">
|
||||
<div className="mx-auto flex max-w-7xl items-center justify-between px-4 py-4">
|
||||
|
|
@ -12,17 +19,29 @@ export function Header() {
|
|||
<span>StudyAI</span>
|
||||
</Link>
|
||||
<nav className="flex items-center gap-4">
|
||||
<Link to="/dashboard">
|
||||
<Button variant="ghost">Dashboard</Button>
|
||||
</Link>
|
||||
<Link to="/auth/login">
|
||||
<Button variant="ghost">Log in</Button>
|
||||
</Link>
|
||||
<Link to="/auth/signup">
|
||||
<Button>Sign up</Button>
|
||||
</Link>
|
||||
{session ? (
|
||||
<>
|
||||
<Link to="/dashboard">
|
||||
<Button variant="ghost">Dashboard</Button>
|
||||
</Link>
|
||||
<Button variant="ghost" onClick={handleSignOut}>
|
||||
Sign out
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Link to="/auth/login">
|
||||
<Button variant="ghost">Log in</Button>
|
||||
</Link>
|
||||
<Link to="/auth/signup">
|
||||
<Button>Sign up</Button>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Header };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue