import { useState } from 'react' import { Layout } from './components/Layout' import { CaseSelector } from './components/CaseSelector' import { NiiVueViewer } from './components/NiiVueViewer' import { MetricsPanel } from './components/MetricsPanel' import { ProgressIndicator } from './components/ProgressIndicator' import { useSegmentation } from './hooks/useSegmentation' export default function App() { const [selectedCase, setSelectedCase] = useState(null) const { result, isLoading, error, jobStatus, progress, progressMessage, elapsedSeconds, runSegmentation, cancelJob, } = useSegmentation() const handleRunSegmentation = async () => { if (selectedCase) { await runSegmentation(selectedCase) } } // Show progress indicator when job is active const showProgress = isLoading && jobStatus && jobStatus !== 'completed' return (
{/* Left Panel: Controls */}
{/* Cancel button when processing */} {isLoading && ( )} {/* Progress indicator */} {showProgress && ( )} {/* Error display */} {error && !isLoading && (

Error

{error}

)} {/* Results metrics */} {result && }
{/* Right Panel: Viewer */}
{result ? ( ) : (

{isLoading ? 'Processing segmentation...' : 'Select a case and run segmentation to view results'}

)}
) }