'use client' import { memo } from 'react' import { Handle, Position } from '@xyflow/react' import type { NodeProps } from '@xyflow/react' import type { RecipientNodeData } from '@/lib/types' function RecipientNode({ data, selected }: NodeProps) { const { label, received, target } = data as RecipientNodeData const progress = Math.min(100, (received / target) * 100) const isFunded = received >= target return (
{/* Input Handle */} {/* Header */}
{label} {isFunded && ( )}
{/* Body */}
Received ${received.toLocaleString()}
{/* Progress bar */}
Progress {progress.toFixed(0)}%
Target ${target.toLocaleString()}
) } export default memo(RecipientNode)