Vector Motion
Medical

Discharge Planning Card - Care Coordination

Monitor discharge planning and patient transitions. Track follow-up care arrangements and patient handoffs.

Discharge Planning Card

The Discharge Planning Card Monitor patient discharge planning status and readiness.

Preview

Installation

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

Discharge Planning Card
'use client'import React from 'react';import { LogOut, CheckCircle, Clock, AlertTriangle } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";function cn(...inputs: ClassValue[]) {   return twMerge(clsx(inputs));}interface PlanningStep {   label: string;   status: string;}interface DischargePlanningCardProps {   className?: string;   title?: string;   subtitle?: string;   pendingCount?: number;   readyCount?: number;   nextPatient?: {      room: string;      name: string;      status: string;   };   steps?: PlanningStep[];}const DEFAULT_STEPS: PlanningStep[] = [   { label: 'Med Rec', status: 'done' },   { label: 'Patient Ed', status: 'done' },   { label: 'Follow-up', status: 'in-progress' },   { label: 'Transport', status: 'pending' }];const DEFAULT_NEXT_PATIENT = {   room: "Rm 402",   name: "M. Thompson",   status: "In Progress"};const DEFAULT_TITLE = "Discharges";const DEFAULT_SUBTITLE = "Planning Status";const DEFAULT_PENDING_COUNT = 8;const DEFAULT_READY_COUNT = 4;export const DischargePlanningCard: React.FC<DischargePlanningCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   pendingCount = DEFAULT_PENDING_COUNT,   readyCount = DEFAULT_READY_COUNT,   nextPatient = DEFAULT_NEXT_PATIENT,   steps = DEFAULT_STEPS,}) => {   const isInteractive = true;   const index = 11;   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-4 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">                  <LogOut className="h-5 w-5" />               </div>            </div>            <div className="flex-1 space-y-4">               <div className="flex items-center justify-between">                  <div>                     <p className="text-2xl font-bold text-foreground">{pendingCount}</p>                     <p className="text-xs text-muted-foreground font-medium">Pending Today</p>                  </div>                  <div className="text-right">                     <p className="text-2xl font-bold text-emerald-500">{readyCount}</p>                     <p className="text-xs text-muted-foreground font-medium">Ready to Go</p>                  </div>               </div>               {/* Progress Tracker based on "Next Up" patient */}               <div className="bg-muted rounded-xl p-3 border border-border">                  <div className="flex justify-between items-center mb-3">                     <span className="text-xs font-bold text-foreground">{nextPatient.room} • {nextPatient.name}</span>                     <span className="text-[10px] bg-indigo-100 dark:bg-indigo-900/30 text-indigo-600 dark:text-indigo-400 px-2 py-0.5 rounded-full font-medium">{nextPatient.status}</span>                  </div>                  <div className="grid grid-cols-4 gap-1">                     {steps.map((step, i) => {                        let color = "bg-zinc-200 dark:bg-zinc-700";                        if (step.status === 'done') color = "bg-indigo-500";                        if (step.status === 'in-progress') color = "bg-indigo-300 dark:bg-indigo-700 animate-pulse";                        return (                           <div key={i} className="flex flex-col gap-1 items-center">                              <div className={`h-1.5 w-full rounded-full ${color}`} />                              <span className="text-[9px] text-zinc-400 font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-full">{step.label}</span>                           </div>                        )                     })}                  </div>               </div>            </div>         </div>      </motion.div>   );};

Usage

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

Prop

Type