'use client'; import { ProjectBaseInfo } from '@/lib/fetch'; import { format } from 'date-fns'; import Link from 'next/link'; import { useParams } from 'next/navigation'; import { cn } from '@/lib/utils'; import Chip from '../ui/Chip'; export interface ProjectCardProps { projectInfo: ProjectBaseInfo; } export enum LabelType { BoundingBox = 'bounding_box', Segmentation = 'segmentation', Classification = 'classification', AnomalyDetection = 'anomaly_detection', SegmentationInstantLearning = 'segmentation_instant_learning', } const LabelTypeDisplayText: { [key: string]: string } = { [LabelType.BoundingBox]: 'detection', [LabelType.Segmentation]: 'segmentation', [LabelType.Classification]: 'classification', [LabelType.AnomalyDetection]: 'anomaly', [LabelType.SegmentationInstantLearning]: 'vp', }; const ProjectCard: React.FC = ({ projectInfo }) => { const { id, name, created_at, label_type, orgName, subscription } = projectInfo; const { projectId: projectIdFromParam } = useParams(); const formattedDate = format(created_at, 'yyyy-MM-dd'); return (

{orgName}

{subscription}

{name}

{formattedDate}

); }; export default ProjectCard;