'use client'

import { Handle, Position, type NodeProps } from '@xyflow/react'

export default function SourceNode({ data }: NodeProps) {
  return (
    <div className="flow-node">
      <Handle type="source" position={Position.Right} className="!bg-flow !w-3 !h-3 !rounded-full !border-0" />
      <div className="text-center">
        <div className="text-flow/70 text-lg mb-1">◉</div>
        <div className="text-foam/60 text-xs font-light">{(data as any).label || 'Source'}</div>
        {(data as any).flowRate !== undefined && (
          <div className="text-flow/40 text-[10px] mt-1 font-light">
            {(data as any).flowRate} units/s
          </div>
        )}
      </div>
    </div>
  )
}
