import { Avatar, AvatarFallback, AvatarImage, } from '@affine/admin/components/ui/avatar'; import type { UserType } from '@affine/graphql'; import { FeatureType } from '@affine/graphql'; import type { ColumnDef } from '@tanstack/react-table'; import clsx from 'clsx'; import { LockIcon, MailIcon, MailWarningIcon, UnlockIcon, UserIcon, } from 'lucide-react'; import type { ReactNode } from 'react'; import { DataTableRowActions } from './data-table-row-actions'; const StatusItem = ({ condition, IconTrue, IconFalse, textTrue, textFalse, }: { condition: boolean | null; IconTrue: ReactNode; IconFalse: ReactNode; textTrue: string; textFalse: string; }) => (
{condition ? ( <> {IconTrue} {textTrue} ) : ( <> {IconFalse} {textFalse} )}
); export const columns: ColumnDef[] = [ { accessorKey: 'info', cell: ({ row }) => (
{row.original.name}{' '} {row.original.features.includes(FeatureType.Admin) && ( Admin )}
{row.original.email}
), enableSorting: false, enableHiding: false, }, { accessorKey: 'property', cell: ({ row: { original: user } }) => (
{user.id}
} IconFalse={} textTrue="Password Set" textFalse="No Password" /> } IconFalse={} textTrue="Email Verified" textFalse="Email Not Verified" />
), }, ];