'use client'; import { Database } from '@prisma/client'; import { ColumnDef } from '@tanstack/react-table'; import Image from 'next/image'; import { databaseProviders } from '@/lib/deploy/database-config'; import { cn } from '@/lib/utils'; interface IDatabase extends Pick { status: any; } export const columns: ColumnDef[] = [ { accessorKey: 'provider', header: 'Provider', cell(props) { return (
pro.id.toUpperCase() === props.getValue())[0]?.image?.src} alt={databaseProviders.filter((pro) => pro.id.toUpperCase() === props.getValue())[0]?.image?.alt} width={32} height={32} />
); }, }, { accessorKey: 'name', header: 'Name', }, { accessorKey: 'createdAt', header: 'Created', cell(props) { return {new Date(props.getValue() as string).toLocaleDateString('en-US', { hour: '2-digit', minute: '2-digit' })}; }, }, ];