Vector Motion
Medical

Dialysis Center Card - Renal Care

Monitor dialysis center operations and patient treatments. Track dialysis sessions and patient outcomes.

Dialysis Center Card

The Dialysis Center Card Monitor dialysis center capacity, patient schedules, and equipment status.

Preview

Installation

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

Dialysis Center Card
'use client'import React from 'react';import { Filter, Droplets, RotateCw } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { PieChart, Pie, Cell, ResponsiveContainer } from 'recharts';function cn(...inputs: ClassValue[]) {   return twMerge(clsx(inputs));}interface DialysisData {   name: string;   value: number;   color: string;   [key: string]: any;}interface DialysisCenterCardProps {   className?: string;   title?: string;   subtitle?: string;   totalChairs?: number;   activeCount?: number;   turnoverCount?: number;   data?: DialysisData[];}const DEFAULT_DATA: DialysisData[] = [   { name: 'Active', value: 10, color: '#3b82f6' }, // blue-500   { name: 'Turnover', value: 2, color: '#fbbf24' },  // amber-400];const DEFAULT_TITLE = "Dialysis";const DEFAULT_SUBTITLE = "Chair Status";const DEFAULT_TOTAL_CHAIRS = 12;const DEFAULT_ACTIVE_COUNT = 10;const DEFAULT_TURNOVER_COUNT = 2;export const DialysisCenterCard: React.FC<DialysisCenterCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   totalChairs = DEFAULT_TOTAL_CHAIRS,   activeCount = DEFAULT_ACTIVE_COUNT,   turnoverCount = DEFAULT_TURNOVER_COUNT,   data = DEFAULT_DATA,}) => {   const isInteractive = true;   const index = 46;   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-primary/50 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-blue-500"></span>                     </span>                     <p className="text-sm text-muted-foreground font-medium">                        {subtitle}                     </p>                  </div>               </div>               <div className="rounded-xl bg-blue-500/10 p-2.5 text-blue-500 flex items-center justify-center ring-1 ring-blue-100 dark:ring-blue-800">                  <Filter className="h-5 w-5" />               </div>            </div>            <div className="flex-1 flex items-center gap-4">               <div className="relative h-20 w-20 flex-shrink-0">                  <ResponsiveContainer width="100%" height="100%">                     <PieChart>                        <Pie                           data={data}                           innerRadius={25}                           outerRadius={36}                           paddingAngle={4}                           dataKey="value"                           stroke="none"                        >                           {data.map((entry, index) => (                              <Cell key={`cell-${index}`} fill={entry.color} />                           ))}                        </Pie>                     </PieChart>                  </ResponsiveContainer>                  <div className="absolute inset-0 flex items-center justify-center">                     <span className="text-xl font-bold text-foreground">{totalChairs}</span>                  </div>               </div>               <div className="flex-1 space-y-2">                  <div className="flex items-center justify-between text-xs">                     <div className="flex items-center gap-1.5">                        <div className="h-2 w-2 rounded-full bg-blue-500" />                        <span className="text-muted-foreground font-medium">Active</span>                     </div>                     <span className="font-bold text-foreground">{activeCount}</span>                  </div>                  <div className="flex items-center justify-between text-xs">                     <div className="flex items-center gap-1.5">                        <div className="h-2 w-2 rounded-full bg-amber-400" />                        <span className="text-muted-foreground font-medium">Turnover</span>                     </div>                     <span className="font-bold text-foreground">{turnoverCount}</span>                  </div>               </div>            </div>            <div className="mt-3 flex items-center gap-2 p-2 rounded-lg bg-emerald-500/10 border border-emerald-100 dark:border-emerald-900/30">               <Droplets className="h-3.5 w-3.5 text-emerald-500" />               <span className="text-xs font-semibold text-emerald-700 dark:text-emerald-300">Water Quality Pass</span>            </div>         </div>      </motion.div>   );};

Usage

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

Prop

Type