|
|
@@ -14,8 +14,11 @@ import { TopNav } from '@/components/top-nav'
|
|
|
import { UserNav } from '@/components/user-nav'
|
|
|
import { RecentSales } from './components/recent-sales'
|
|
|
import { Overview } from './components/overview'
|
|
|
+import { useTranslations } from 'use-intl'
|
|
|
+import LanguageSwitch from '@/components/language-switch'
|
|
|
|
|
|
export default function Dashboard() {
|
|
|
+ const t = useTranslations('dashboard')
|
|
|
return (
|
|
|
<Layout>
|
|
|
{/* ===== Top Heading ===== */}
|
|
|
@@ -24,6 +27,7 @@ export default function Dashboard() {
|
|
|
<div className='ml-auto flex items-center space-x-4'>
|
|
|
<Search />
|
|
|
<ThemeSwitch />
|
|
|
+ <LanguageSwitch />
|
|
|
<UserNav />
|
|
|
</div>
|
|
|
</Layout.Header>
|
|
|
@@ -31,9 +35,11 @@ export default function Dashboard() {
|
|
|
{/* ===== Main ===== */}
|
|
|
<Layout.Body>
|
|
|
<div className='mb-2 flex items-center justify-between space-y-2'>
|
|
|
- <h1 className='text-2xl font-bold tracking-tight'>Dashboard</h1>
|
|
|
+ <h1 className='text-2xl font-bold tracking-tight'>
|
|
|
+ {t('dashboard')}
|
|
|
+ </h1>
|
|
|
<div className='flex items-center space-x-2'>
|
|
|
- <Button>Download</Button>
|
|
|
+ <Button>{t('download')}</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Tabs
|
|
|
@@ -43,10 +49,12 @@ export default function Dashboard() {
|
|
|
>
|
|
|
<div className='w-full overflow-x-auto pb-2'>
|
|
|
<TabsList>
|
|
|
- <TabsTrigger value='overview'>Overview</TabsTrigger>
|
|
|
- <TabsTrigger value='analytics'>Analytics</TabsTrigger>
|
|
|
- <TabsTrigger value='reports'>Reports</TabsTrigger>
|
|
|
- <TabsTrigger value='notifications'>Notifications</TabsTrigger>
|
|
|
+ <TabsTrigger value='overview'>{t('overview')}</TabsTrigger>
|
|
|
+ <TabsTrigger value='analytics'>{t('analytics')}</TabsTrigger>
|
|
|
+ <TabsTrigger value='reports'>{t('reports')}</TabsTrigger>
|
|
|
+ <TabsTrigger value='notifications'>
|
|
|
+ {t('notifications')}
|
|
|
+ </TabsTrigger>
|
|
|
</TabsList>
|
|
|
</div>
|
|
|
<TabsContent value='overview' className='space-y-4'>
|
|
|
@@ -54,7 +62,7 @@ export default function Dashboard() {
|
|
|
<Card>
|
|
|
<CardHeader className='flex flex-row items-center justify-between space-y-0 pb-2'>
|
|
|
<CardTitle className='text-sm font-medium'>
|
|
|
- Total Revenue
|
|
|
+ {t('total_revenue')}
|
|
|
</CardTitle>
|
|
|
<svg
|
|
|
xmlns='http://www.w3.org/2000/svg'
|
|
|
@@ -72,14 +80,14 @@ export default function Dashboard() {
|
|
|
<CardContent>
|
|
|
<div className='text-2xl font-bold'>$45,231.89</div>
|
|
|
<p className='text-xs text-muted-foreground'>
|
|
|
- +20.1% from last month
|
|
|
+ {t('from_last_month', { amount: '+20.1%' })}
|
|
|
</p>
|
|
|
</CardContent>
|
|
|
</Card>
|
|
|
<Card>
|
|
|
<CardHeader className='flex flex-row items-center justify-between space-y-0 pb-2'>
|
|
|
<CardTitle className='text-sm font-medium'>
|
|
|
- Subscriptions
|
|
|
+ {t('subscriptions')}
|
|
|
</CardTitle>
|
|
|
<svg
|
|
|
xmlns='http://www.w3.org/2000/svg'
|
|
|
@@ -99,13 +107,15 @@ export default function Dashboard() {
|
|
|
<CardContent>
|
|
|
<div className='text-2xl font-bold'>+2350</div>
|
|
|
<p className='text-xs text-muted-foreground'>
|
|
|
- +180.1% from last month
|
|
|
+ {t('from_last_month', { amount: '+180.1%' })}
|
|
|
</p>
|
|
|
</CardContent>
|
|
|
</Card>
|
|
|
<Card>
|
|
|
<CardHeader className='flex flex-row items-center justify-between space-y-0 pb-2'>
|
|
|
- <CardTitle className='text-sm font-medium'>Sales</CardTitle>
|
|
|
+ <CardTitle className='text-sm font-medium'>
|
|
|
+ {t('sales')}
|
|
|
+ </CardTitle>
|
|
|
<svg
|
|
|
xmlns='http://www.w3.org/2000/svg'
|
|
|
viewBox='0 0 24 24'
|
|
|
@@ -123,14 +133,14 @@ export default function Dashboard() {
|
|
|
<CardContent>
|
|
|
<div className='text-2xl font-bold'>+12,234</div>
|
|
|
<p className='text-xs text-muted-foreground'>
|
|
|
- +19% from last month
|
|
|
+ {t('from_last_month', { amount: '+19%' })}
|
|
|
</p>
|
|
|
</CardContent>
|
|
|
</Card>
|
|
|
<Card>
|
|
|
<CardHeader className='flex flex-row items-center justify-between space-y-0 pb-2'>
|
|
|
<CardTitle className='text-sm font-medium'>
|
|
|
- Active Now
|
|
|
+ {t('active_now')}
|
|
|
</CardTitle>
|
|
|
<svg
|
|
|
xmlns='http://www.w3.org/2000/svg'
|
|
|
@@ -148,7 +158,7 @@ export default function Dashboard() {
|
|
|
<CardContent>
|
|
|
<div className='text-2xl font-bold'>+573</div>
|
|
|
<p className='text-xs text-muted-foreground'>
|
|
|
- +201 since last hour
|
|
|
+ {t('since_last_hour', { amount: '+201' })}
|
|
|
</p>
|
|
|
</CardContent>
|
|
|
</Card>
|
|
|
@@ -156,7 +166,7 @@ export default function Dashboard() {
|
|
|
<div className='grid grid-cols-1 gap-4 lg:grid-cols-7'>
|
|
|
<Card className='col-span-1 lg:col-span-4'>
|
|
|
<CardHeader>
|
|
|
- <CardTitle>Overview</CardTitle>
|
|
|
+ <CardTitle>{t('overview')}</CardTitle>
|
|
|
</CardHeader>
|
|
|
<CardContent className='pl-2'>
|
|
|
<Overview />
|
|
|
@@ -164,9 +174,9 @@ export default function Dashboard() {
|
|
|
</Card>
|
|
|
<Card className='col-span-1 lg:col-span-3'>
|
|
|
<CardHeader>
|
|
|
- <CardTitle>Recent Sales</CardTitle>
|
|
|
+ <CardTitle>{t('recent_sales')}</CardTitle>
|
|
|
<CardDescription>
|
|
|
- You made 265 sales this month.
|
|
|
+ {t('recent_sales_desc', { amount: '265' })}
|
|
|
</CardDescription>
|
|
|
</CardHeader>
|
|
|
<CardContent>
|
|
|
@@ -183,22 +193,22 @@ export default function Dashboard() {
|
|
|
|
|
|
const topNav = [
|
|
|
{
|
|
|
- title: 'Overview',
|
|
|
+ title: 'dashboard.overview',
|
|
|
href: 'dashboard/overview',
|
|
|
isActive: true,
|
|
|
},
|
|
|
{
|
|
|
- title: 'Customers',
|
|
|
+ title: 'dashboard.customers',
|
|
|
href: 'dashboard/customers',
|
|
|
isActive: false,
|
|
|
},
|
|
|
{
|
|
|
- title: 'Products',
|
|
|
+ title: 'dashboard.products',
|
|
|
href: 'dashboard/products',
|
|
|
isActive: false,
|
|
|
},
|
|
|
{
|
|
|
- title: 'Settings',
|
|
|
+ title: 'dashboard.settings',
|
|
|
href: 'dashboard/settings',
|
|
|
isActive: false,
|
|
|
},
|