From 2ab653554693d463356abbc81f76f55d442a4517 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 18 Jan 2026 00:59:50 +0000 Subject: [PATCH] Simplify feature idea node type exports --- src/components/FeatureIdeaCloud/nodes.tsx | 145 +--------------------- 1 file changed, 2 insertions(+), 143 deletions(-) diff --git a/src/components/FeatureIdeaCloud/nodes.tsx b/src/components/FeatureIdeaCloud/nodes.tsx index 7009579..c8f20cc 100644 --- a/src/components/FeatureIdeaCloud/nodes.tsx +++ b/src/components/FeatureIdeaCloud/nodes.tsx @@ -1,146 +1,5 @@ -import { useState, useEffect, ReactElement } from 'react' -import { NodeProps, Handle, Position } from 'reactflow' -import { Button } from '@/components/ui/button' -import { Card } from '@/components/ui/card' -import { Badge } from '@/components/ui/badge' -import { DotsThree } from '@phosphor-icons/react' -import { FeatureIdea, IdeaGroup } from './types' -import { PRIORITY_COLORS, STATUS_COLORS } from './constants' -import groupColorsData from './data/group-colors.json' - -const GROUP_COLORS = groupColorsData as Array<{ name: string; value: string; bg: string; border: string }> - -export function GroupNode({ data, selected }: NodeProps) { - const colorScheme = GROUP_COLORS.find(c => c.value === data.color) || GROUP_COLORS[0] - - return ( -
-
- {data.label} -
- -
- ) -} - -export function IdeaNode({ data, selected, id }: NodeProps & { id: string }) { - const [connectionCounts, setConnectionCounts] = useState>({ - left: 0, - right: 0, - top: 0, - bottom: 0, - }) - - useEffect(() => { - const updateConnectionCounts = (event: CustomEvent) => { - const { nodeId, counts } = event.detail - if (nodeId === id) { - setConnectionCounts(counts) - } - } - - window.addEventListener('updateConnectionCounts' as any, updateConnectionCounts as EventListener) - return () => { - window.removeEventListener('updateConnectionCounts' as any, updateConnectionCounts as EventListener) - } - }, [id]) - - const generateHandles = (position: Position, type: 'source' | 'target', side: string) => { - const count = connectionCounts[side] || 0 - const totalHandles = Math.max(2, count + 1) - const handles: ReactElement[] = [] - - for (let i = 0; i < totalHandles; i++) { - const handleId = `${side}-${i}` - const isVertical = position === Position.Top || position === Position.Bottom - const positionStyle = isVertical - ? { left: `${((i + 1) / (totalHandles + 1)) * 100}%` } - : { top: `${((i + 1) / (totalHandles + 1)) * 100}%` } - - handles.push( - - ) - } - - return handles - } - - return ( -
- {generateHandles(Position.Left, 'target', 'left')} - {generateHandles(Position.Right, 'source', 'right')} - {generateHandles(Position.Top, 'target', 'top')} - {generateHandles(Position.Bottom, 'source', 'bottom')} - - -
-
-

{data.title}

- -
-

- {data.description} -

-
- - {data.category} - - - {data.status} - -
-
-
-
- ) -} +import { IdeaNode } from './IdeaNode' +import { GroupNode } from './GroupNode' export const nodeTypes = { ideaNode: IdeaNode,