update:routing

This commit is contained in:
2026-03-09 15:31:04 +09:00
parent 685521f118
commit 8a3c10e785
4 changed files with 41 additions and 65 deletions

View File

@@ -17,12 +17,16 @@ function StatCard({ label, value }: StatCardProps) {
)
}
export function AdminPage() {
interface AdminPageProps {
isAuthenticated: boolean
}
export function AdminPage({ isAuthenticated }: AdminPageProps) {
const [tickets, setTickets] = useState<Ticket[]>([])
useEffect(() => {
storage.getTickets().then(setTickets)
}, [])
storage.getAllTickets(isAuthenticated).then(setTickets)
}, [isAuthenticated])
const stats = {
total: tickets.length,
@@ -35,7 +39,9 @@ export function AdminPage() {
<>
<div className="mb-6">
<h1 className="text-lg font-semibold text-fg-100">Admin</h1>
<p className="mt-0.5 text-sm text-fg-300">All tickets across the system</p>
<p className="mt-0.5 text-sm text-fg-300">
{isAuthenticated ? 'All tickets across the system' : 'Your local tickets'}
</p>
</div>
<div className="mb-6 grid grid-cols-4 gap-3">