import React, { useState } from 'react'; import { Button } from '../../../../ui-next/src/components/Button'; import { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, } from '../../../../ui-next/src/components/Select'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuLabel, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuPortal, } from '../../../../ui-next/src/components/DropdownMenu'; import { Icons } from '../../../../ui-next/src/components/Icons/Icons'; import { DataRow } from '../../../../ui-next/src/components/DataRow'; import { actionOptionsMap, dataList } from '../../../../ui-next/assets/data'; import { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from '../../../../ui-next/src/components/Accordion/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, TabsContent } from '../../../../ui-next/src/components/Tabs'; import { ChevronDownIcon } from '@radix-ui/react-icons'; 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 TMTVPatterns() { 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)); }; // Find the "TMTV2" group const tmv2Group = dataList.find((listGroup: ListGroup) => listGroup.type === 'TMTV2'); // Find the "TMTV1" group const tmvGroup = dataList.find((listGroup: ListGroup) => listGroup.type === 'TMTV1'); // Check if both groups exist if (!tmv2Group) { return
TMTV2 data not found.
; } if (!tmvGroup) { return
TMTV1 data not found.
; } return (
{/* Segmentation Tools */} Segmentation Tools
{/* Segmentation List */} Segmentation List {/* 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 */}
{/* TMTV1 Group */}
{/* Left Group: DropdownMenu and TMTV1 Label */}
Add Segment Remove from Viewport Rename Hide or Show all Segments Export & Download Export DICOM SEG Download DICOM SEG Download DICOM RTSTRUCT Delete
TMTV1 Segmentation
{/* Data Rows for TMTV1 */}
{tmvGroup.items.map((item, index) => { const compositeId = `${tmvGroup.type}-${item.id}-panel`; // Ensure unique composite ID return ( handleAction(compositeId, action)} isSelected={selectedRowId === compositeId} onSelect={() => handleRowSelect(compositeId)} /> ); })}
{/* TMTV2 Group */}
Add Segment Remove from Viewport Rename Hide or Show all Segments Export & Download Export DICOM SEG Download DICOM SEG Download DICOM RTSTRUCT Delete
TMTV2 Segmentation
{/* Data Rows for TMTV2 */}
{tmv2Group.items.map((item, index) => { const compositeId = `${tmv2Group.type}-${item.id}-panel`; // Ensure unique composite ID return ( handleAction(compositeId, action)} isSelected={selectedRowId === compositeId} onSelect={() => handleRowSelect(compositeId)} /> ); })}
{/* Footer or Additional Information */}
TMTV 21.555 mL
); }