Update admin and marketing layouts, add new admin components
Refined both admin and marketing layouts for a clearer design. Newly added components for the admin page include admin-account-page, admin-members-table and admin-memberships-table. Also included in this update are route renaming, minor text edits and corrections in the code.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ColumnDef } from '@tanstack/react-table';
|
||||
|
||||
import { Database } from '@kit/supabase/database';
|
||||
import { DataTable } from '@kit/ui/enhanced-data-table';
|
||||
|
||||
type Membership =
|
||||
Database['public']['Tables']['accounts_memberships']['Row'] & {
|
||||
account: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
|
||||
export function AdminMembershipsTable(props: { memberships: Membership[] }) {
|
||||
return <DataTable data={props.memberships} columns={getColumns()} />;
|
||||
}
|
||||
|
||||
function getColumns(): ColumnDef<Membership>[] {
|
||||
return [
|
||||
{
|
||||
header: 'User ID',
|
||||
accessorKey: 'user_id',
|
||||
},
|
||||
{
|
||||
header: 'Team',
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<Link
|
||||
className={'hover:underline'}
|
||||
href={`/admin/accounts/${row.original.account_id}`}
|
||||
>
|
||||
{row.original.account.name}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
header: 'Role',
|
||||
accessorKey: 'account_role',
|
||||
},
|
||||
{
|
||||
header: 'Created At',
|
||||
accessorKey: 'created_at',
|
||||
},
|
||||
{
|
||||
header: 'Updated At',
|
||||
accessorKey: 'updated_at',
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user