64 lines
2.1 KiB
TypeScript
64 lines
2.1 KiB
TypeScript
import { createFileRoute, Link } from '@tanstack/react-router'
|
|
import { AppContainer, p as MyText } from 'web-components'
|
|
import { Send, Settings2, ChevronRight } from 'lucide-react'
|
|
import { ProtectedRoute } from '../components/ProtectedRoute'
|
|
import { AppShell } from '../components/AppShell'
|
|
|
|
export const Route = createFileRoute('/dashboard')({
|
|
component: () => (
|
|
<ProtectedRoute>
|
|
<AppShell>
|
|
<Dashboard />
|
|
</AppShell>
|
|
</ProtectedRoute>
|
|
),
|
|
})
|
|
|
|
const CARDS = [
|
|
{
|
|
to: '/send-notifications',
|
|
title: 'Send Admin Notifications',
|
|
description: 'Push a message to every admin device.',
|
|
icon: Send,
|
|
},
|
|
{
|
|
to: '/constants',
|
|
title: 'App Constants',
|
|
description: 'Tune delivery thresholds, charges and app config.',
|
|
icon: Settings2,
|
|
},
|
|
] as const
|
|
|
|
function Dashboard() {
|
|
return (
|
|
<AppContainer>
|
|
<div className="bg-gray-50 p-4">
|
|
<MyText className="mb-1 block text-2xl font-bold text-gray-900">Dashboard</MyText>
|
|
<MyText className="mb-6 block text-gray-600">
|
|
Manage the Freshyo platform.
|
|
</MyText>
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
{CARDS.map(({ to, title, description, icon: Icon }) => (
|
|
<Link
|
|
key={to}
|
|
to={to}
|
|
className="flex items-center justify-between rounded-xl border border-gray-200 bg-white p-5 shadow-sm transition-colors hover:border-blue-300 hover:bg-blue-50/40"
|
|
>
|
|
<div className="flex items-center gap-4">
|
|
<div className="flex h-11 w-11 items-center justify-center rounded-lg bg-blue-50">
|
|
<Icon className="h-6 w-6 text-blue-600" />
|
|
</div>
|
|
<div>
|
|
<MyText className="block font-semibold text-gray-900">{title}</MyText>
|
|
<MyText className="block text-sm text-gray-500">{description}</MyText>
|
|
</div>
|
|
</div>
|
|
<ChevronRight className="h-5 w-5 text-gray-400" />
|
|
</Link>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</AppContainer>
|
|
)
|
|
}
|