Starting working on settings Page.

This commit is contained in:
charles-gauthereau
2024-11-16 17:05:55 +01:00
parent 9727eef581
commit b8218dcf85
11 changed files with 126 additions and 14 deletions
@@ -0,0 +1,36 @@
"use client"
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
import {usersColumns} from "@/components/wrappers/Dashboard/Settings/SettingsTabs/columns-users";
import {User} from "@prisma/client";
import {backupColumns} from "@/features/backup/columns";
export type SettingsTabsProps = {
users: User[];
}
export const SettingsTabs = (props: SettingsTabsProps) => {
return(
<Tabs defaultValue="informations" >
<TabsList className="w-full" >
<TabsTrigger className="w-full" value="informations">Informations</TabsTrigger>
<TabsTrigger className="w-full" value="users">Users</TabsTrigger>
<TabsTrigger className="w-full" value="email">Email</TabsTrigger>
<TabsTrigger className="w-full" value="storage">Storage</TabsTrigger>
</TabsList>
<TabsContent value="informations">
ok
</TabsContent>
<TabsContent value="users" className="h-full justify-between">
<DataTableWithPagination columns={usersColumns} data={props.users}/>
</TabsContent>
<TabsContent value="email">Change your password here.</TabsContent>
<TabsContent value="storage">Change your password here.</TabsContent>
</Tabs>
)
}
@@ -0,0 +1,34 @@
"use client"
import {ColumnDef} from "@tanstack/react-table"
import {Badge} from "@/components/ui/badge";
import {User} from "@prisma/client";
export const usersColumns: ColumnDef<User>[] = [
{
accessorKey: "id",
header: "Id",
},
{
accessorKey: "name",
header: "Name"
},
{
accessorKey: "email",
header: "Email"
},
{
accessorKey: "createdAt",
header: "Created At",
cell: ({row}) => {
return new Date(row.getValue("createdAt")).toLocaleString("fr-FR");
},
},
{
accessorKey: "authMethod",
header: "Method",
cell: ({row}) => {
return <Badge variant="outline">{row.getValue("authMethod")}</Badge>
},
}
]