'use client'; import {proportional} from '@astryxdesign/core/Table'; import type {TableColumn} from '@astryxdesign/core/Table'; import {VStack, HStack} from '@astryxdesign/core/Layout'; import {Text} from '@astryxdesign/core/Text'; import {Avatar} from '@astryxdesign/core/Avatar'; import {Badge} from '@astryxdesign/core/Badge'; import {PanelCard} from '@/shared/components/patterns/PanelCard'; import {ResponsiveTable} from '@/shared/components/patterns/ResponsiveTable'; import {SkeletonRows} from '@/shared/components/patterns/LoadingState'; import {EmptyPanel} from '@/shared/components/patterns/EmptyPanel'; import type {TeamMember} from '@/features/team/types/team'; import type {Resource} from '@/shared/hooks/useResource'; interface Row extends Record { id: string; name: string; email: string; role: string; } const COLUMNS: TableColumn[] = [ { key: 'name', header: 'Person', width: proportional(1), renderCell: (row) => ( {row.name} {row.email} ), }, { key: 'role', header: 'Role', align: 'end', // Role IS an enumerated state, which is what a Badge is for — unlike a // status, which is a dot. renderCell: (row) => , }, ]; export function TeamTable({resource}: {resource: Resource}) { return ( } empty={ } > {(members) => ( ({ id: m.id, name: m.name, email: m.email, role: m.role, }))} columns={COLUMNS} idKey="id" primaryKey="name" density="balanced" /> )} ); }