parsimony/admin/src/components/Shell.tsx
tgiachi 1dddf14cfd feat: the logo in the admin UI, the README and as PNG exports
- Show the wordmark on the login page and the mark in the header; set the page title to Parsimony
- Put the logo at the top of the README, with a dark-mode variant
- Add PNG exports (a 512 px mark for avatars, a 1200 px wordmark), both transparent
- Say that the logo is under the same licence
2026-11-10 12:14:50 +01:00

33 lines
1.2 KiB
TypeScript

import { Link, Navigate, Outlet, useLocation } from 'react-router'
import { Button } from '@/components/ui/button'
import { useAuth } from '@/lib/auth'
/** Layout for every page that needs a session. */
export function Shell() {
const { authed, logout } = useAuth()
const location = useLocation()
if (!authed) return <Navigate to="/login" replace state={{ from: location.pathname }} />
return (
<div className="min-h-screen">
<header className="border-b">
<div className="mx-auto flex max-w-5xl items-center justify-between p-4">
<div className="flex items-center gap-6">
<Link to="/" className="flex items-center gap-2 text-lg font-semibold">
<img src="/favicon.svg" alt="" className="size-7" />
Parsimony
</Link>
<Link to="/queue" className="text-sm text-muted-foreground hover:text-foreground">
Queue
</Link>
</div>
<Button variant="outline" size="sm" onClick={logout}>
Sign out
</Button>
</div>
</header>
<main className="mx-auto max-w-5xl p-4">
<Outlet />
</main>
</div>
)
}