mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
feat: add i18n with type safety
This commit is contained in:
22
inertia/pages/dashboard.tsx
Normal file
22
inertia/pages/dashboard.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user