Vector Motion
Medical

Pathology Turnaround Card - Pathology Services

Monitor pathology report turnaround times. Track specimen processing and diagnostic accuracy.

Pathology Turnaround Card

The Pathology Turnaround Card Track pathology specimen processing and result turnaround times.

Preview

Installation

ash npx shadcn@latest add https://vectormotion.vercel.app/registry/pathology-turnaround-card.json

Pathology Turnaround Card
'use client'import React from 'react';import { Microscope, Clock, CheckCircle2 } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { AreaChart, Area, ResponsiveContainer, YAxis } from 'recharts';function cn(...inputs: ClassValue[]) {   return twMerge(clsx(inputs));}interface TurnaroundData {   value: number;   [key: string]: any;}interface PathologyTurnaroundCardProps {   className?: string;   title?: string;   subtitle?: string;   avgTurnaroundTime?: number;   targetMet?: boolean;   data?: TurnaroundData[];}const DEFAULT_DATA: TurnaroundData[] = [   { value: 2.1 }, { value: 2.8 }, { value: 2.3 }, { value: 2.5 }, { value: 1.9 }, { value: 2.4 }, { value: 2.2 }];const DEFAULT_TITLE = "Pathology";const DEFAULT_SUBTITLE = "Biopsy TAT";const DEFAULT_AVG_TURNAROUND_TIME = 2.4;const DEFAULT_TARGET_MET = true;export const PathologyTurnaroundCard: React.FC<PathologyTurnaroundCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   avgTurnaroundTime = DEFAULT_AVG_TURNAROUND_TIME,   targetMet = DEFAULT_TARGET_MET,   data = DEFAULT_DATA,}) => {   const isInteractive = true;   const index = 45;   return (      <motion.div         layoutId={isInteractive ? `card-${index}-${title}` : undefined}         transition={{ duration: 0.4, ease: "easeOut" }}         className={cn(            "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all flex flex-col h-full",            isInteractive ? "hover:border-indigo-300 dark:hover:border-indigo-700 hover:shadow-md" : "",            className         )}      >         <div className="p-5 flex flex-col h-full relative z-10">            <div className="mb-2 flex items-start justify-between">               <div>                  <h3 className="font-bold text-lg text-foreground">                     {title}                  </h3>                  <div className="flex items-center gap-1.5 mt-1">                     <span className="relative flex h-2 w-2">                        <span className="relative inline-flex rounded-full h-2 w-2 bg-indigo-500"></span>                     </span>                     <p className="text-sm text-muted-foreground font-medium">                        {subtitle}                     </p>                  </div>               </div>               <div className="rounded-xl bg-indigo-50 dark:bg-indigo-900/20 p-2.5 text-indigo-600 dark:text-indigo-400 flex items-center justify-center ring-1 ring-indigo-100 dark:ring-indigo-800">                  <Microscope className="h-5 w-5" />               </div>            </div>            <div className="flex-1 flex flex-col">               <div className="flex items-baseline gap-2 mb-1">                  <span className="text-4xl font-bold text-foreground tracking-tight">{avgTurnaroundTime}</span>                  <span className="text-sm text-muted-foreground font-medium">days avg</span>               </div>               {targetMet && (                  <div className="flex items-center gap-1.5 text-xs text-emerald-500 mb-4 bg-emerald-50 dark:bg-emerald-900/10 self-start px-2 py-0.5 rounded-full font-medium">                     <CheckCircle2 className="h-3 w-3" />                     Within Target (&lt;3D)                  </div>               )}               {/* Simulated Process Pipeline */}               <div className="space-y-3">                  <div className="relative pt-4">                     {/* Timeline Line */}                     <div className="absolute top-5 left-0 right-0 h-0.5 bg-zinc-100 dark:bg-zinc-800" />                     <div className="flex justify-between relative z-10">                        <div className="flex flex-col items-center gap-1">                           <div className="w-2.5 h-2.5 rounded-full bg-indigo-500 ring-4 ring-white dark:ring-zinc-900" />                           <span className="text-[9px] font-semibold text-muted-foreground uppercase">Grossing</span>                        </div>                        <div className="flex flex-col items-center gap-1">                           <div className="w-2.5 h-2.5 rounded-full bg-indigo-500 ring-4 ring-white dark:ring-zinc-900" />                           <span className="text-[9px] font-semibold text-muted-foreground uppercase">Process</span>                        </div>                        <div className="flex flex-col items-center gap-1">                           <div className="w-2.5 h-2.5 rounded-full bg-indigo-500 ring-4 ring-white dark:ring-zinc-900" />                           <span className="text-[9px] font-semibold text-muted-foreground uppercase">Slide</span>                        </div>                        <div className="flex flex-col items-center gap-1">                           <div className="w-2.5 h-2.5 rounded-full bg-zinc-300 dark:bg-zinc-700 ring-4 ring-white dark:ring-zinc-900" />                           <span className="text-[9px] font-semibold text-muted-foreground uppercase">Report</span>                        </div>                     </div>                  </div>               </div>               {/* Mini Trend Chart */}               <div className="h-10 w-full mt-auto opacity-50">                  <ResponsiveContainer width="100%" height="100%">                     <AreaChart data={data}>                        <Area type="monotone" dataKey="value" stroke="#6366f1" fill="#6366f1" fillOpacity={0.1} strokeWidth={2} />                     </AreaChart>                  </ResponsiveContainer>               </div>            </div>         </div>      </motion.div>   );};

Usage

This component is a demo card displaying medical metrics with animated visualizations and dark mode support.

Prop

Type