'use client'; import React, { useState } from 'react'; import { DataRow } from '../../../../ui-next/src/components/DataRow'; import { Button } from '../../../../ui-next/src/components/Button'; import { Select, SelectValue, SelectTrigger, SelectContent, SelectItem, } from '../../../../ui-next/src/components/Select'; import { Icons } from '../../../../ui-next/src/components/Icons'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuLabel, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuPortal, } from '../../../../ui-next/src/components/DropdownMenu'; import { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from '../../../../ui-next/src/components/Accordion'; import { Slider } from '../../../../ui-next/src/components/Slider'; import { Switch } from '../../../../ui-next/src/components/Switch'; import { Label } from '../../../../ui-next/src/components/Label'; import { Input } from '../../../../ui-next/src/components/Input'; import { Tabs, TabsList, TabsTrigger } from '../../../../ui-next/src/components/Tabs'; import { actionOptionsMap, dataList } from '../../../../ui-next/assets/data'; import { TooltipProvider } from '../../../../ui-next/src/components/Tooltip'; interface DataItem { id: number; title: string; description: string; optionalField?: string; colorHex?: string; details?: string; series?: string; } interface ListGroup { type: string; items: DataItem[]; } export default function SegmentationPanel() { const [selectedRowId, setSelectedRowId] = useState(null); const [selectedTab, setSelectedTab] = useState('Fill & Outline'); const handleAction = (id: string, action: string) => { console.log(`Action "${action}" triggered for item with id: ${id}`); // Implement actual action logic here }; // Handle row selection const handleRowSelect = (id: string) => { setSelectedRowId(prevSelectedId => (prevSelectedId === id ? null : id)); }; const organSegmentationGroup = dataList.find( (listGroup: ListGroup) => listGroup.type === 'Organ Segmentation' ); if (!organSegmentationGroup) { return
Organ Segmentation data not found.
; } return (
{/* Segmentation Tools */} Segmentation Tools
{/* Segmentation List */} Segmentation List
{/* Header Controls */}
Create New Segmentation Manage Current Segmentation Remove from Viewport Rename Export & Download Export DICOM SEG Download DICOM SEG Download DICOM RTSTRUCT Delete
{/* Appearance Settings */}
Appearance Settings
{/* Display Label with Selected Tab */}
Show: {selectedTab}
{/* Tabs Controls */}
{/* Opacity Slider */}
{/* Border Slider */}
{/* Sync Changes Switch */}
{/* Display Inactive Segmentations Switch */}
{/* Additional Opacity Slider */}
{/* Action Buttons */}
{/* Data Rows */}
{organSegmentationGroup.items.map((item, index) => { const compositeId = `${organSegmentationGroup.type}-${item.id}-panel`; // Ensure unique composite ID return ( handleAction(compositeId, action)} isSelected={selectedRowId === compositeId} onSelect={() => handleRowSelect(compositeId)} /> ); })}
); }