import React from 'react'
import { Sparkles } from 'lucide-react'
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
import { NODE_HELP } from '@/lib/graph/nodeHelp'
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
import RenderingNode from './RenderingNode'

const ICON_CLASS = 'mr-2 h-4 w-4'

export function getRenderNodeDescriptor(): NodeTypeDescriptor {
  return createNodeTypeBuilder(
    'render',
    RenderingNode,
    { width: 384, height: 320 },
    { viewportWidth: 1200, viewportHeight: 800 }
  )
    .idPrefix('rnd_')
    .withInputOutput(true, true)
    .classification('pneuma')
    .allowedSourceTypes(['config', 'agent'])
    .allowedTargetTypes(['config', 'agent'])
    .help(NODE_HELP.render)
    .menu('Renderer', <Sparkles className={ICON_CLASS} />)
    .connectionLabelByStatus({ default: 'listening', updating: 'giving life', paused: 'pending', error: 'corrupted' })
    .withFullscreen()
    .build()
}
