feat: add i18n with type safety

This commit is contained in:
Sonny
2024-04-30 00:36:13 +02:00
committed by Sonny
parent 31f22d382e
commit 2cc490b611
32 changed files with 706 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
import type Collection from '#models/collection';
import { Link } from '@inertiajs/react';
import Footer from '~/components/footer/footer';
import DashboardLayout from '~/components/layouts/dashboard_layout';
// type DashboardPageProps = InferPageProps<CollectionsController, 'index'>
type DashboardPageProps = {
collections: Collection[];
};
export default function DashboardPage({ collections }: DashboardPageProps) {
console.log(collections);
return (
<DashboardLayout>
<Link href="/collections/create">Add collection</Link>
{collections.map((collection) => (
<li key={collection.id}>{collection.name}</li>
))}
<Footer />
</DashboardLayout>
);
}