import { ColumnDef } from '@tanstack/react-table'; // Remove server-specific imports to avoid issues in client bundle // import { createSelectSchema, students } from '@workspace/db'; // import * as z from 'zod/v4'; import { Badge } from '@workspace/ui/components/badge'; // import { Button } from '@workspace/ui/components/button'; import { Avatar, AvatarFallback, AvatarImage } from '@workspace/ui/components/avatar'; import { Eye, Mail, Phone, MapPin, Calendar, GraduationCap } from 'lucide-react'; // Define the Student interface locally to avoid importing server-side code export interface Student { id: number; email: string; rollNumber: string | null; verified: boolean; firstName: string | null; middleName: string | null; lastName: string | null; mothersName?: string | null; gender?: string | null; dob?: Date | null; personalGmail?: string | null; phoneNumber?: string | null; address?: string | null; profilePicture?: string | null; degree?: string | null; branch?: string | null; year?: string | null; skills?: string[] | null; ssc?: number | null; hsc?: number | null; isDiploma?: boolean | null; linkedin?: string | null; github?: string | null; createdAt?: Date; } export const columns: ColumnDef[] = [ { accessorKey: 'id', header: 'ID', cell: ({ row }) => { const student = row.original; return (
{student.firstName ? student.firstName.charAt(0).toUpperCase() : student.email ? student.email.charAt(0).toUpperCase() : 'S'}
#{student.id} {student.verified ? 'Verified' : 'Pending'}
); }, }, { accessorKey: 'name', header: 'Student Name', cell: ({ row }) => { const student = row.original; const fullName = [ student.firstName, student.middleName, student.lastName ].filter(Boolean).join(' ') || 'Not provided'; return (
{fullName} {student.rollNumber || 'No Roll Number'}
); }, filterFn: 'includesString', }, { accessorKey: 'email', header: 'Contact Information', cell: ({ row }) => { const student = row.original; return (
{student.email}
{student.phoneNumber && (
{student.phoneNumber}
)} {student.personalGmail && (
{student.personalGmail}
)}
); }, filterFn: 'includesString', }, { accessorKey: 'academic', header: 'Academic Details', cell: ({ row }) => { const student = row.original; return (
{student.degree || 'Not specified'}
{student.branch || 'Branch not specified'}
{student.year || 'Year not specified'}
); }, }, { accessorKey: 'location', header: 'Location', cell: ({ row }) => { const student = row.original; return (
{student.address || 'Address not provided'}
); }, }, { accessorKey: 'skills', header: 'Skills', cell: ({ row }) => { const student = row.original; const skills = student.skills || []; if (skills.length === 0) { return No skills listed; } return (
{skills.slice(0, 3).map((skill, index) => ( {skill} ))} {skills.length > 3 && ( +{skills.length - 3} more )}
); }, }, { id: 'actions', header: 'Actions', cell: ({ row }) => { const student = row.original; return (
View Details
); }, }, ];