import { Modal, Select, Button, Group, Stack, Text, Center } from '@mantine/core'
import { IconAlertCircle } from '@tabler/icons-react'
import { useState } from 'react'
import classes from './AdvancedAnalysisModal.module.css'
const CLASS_METADATA = {
'Drzewa / Las': 'Trees / Forest',
'Zarośla': 'Shrubland',
'Trawa / Łąki': 'Grassland',
'Uprawy rolne': 'Crops',
'Zabudowa': 'Built area',
'Goły grunt': 'Bare Ground',
'Śnieg i lód': 'Snow & Ice',
'Woda': 'Water',
'Tereny podmokłe': 'Flooded vegetation',
'Namorzyny': 'Mangroves',
'Mchy i porosty': 'Moss & Lichen',
'Brak danych': 'No Data'
};
const MASK_INFO = {
water_ndwi: { name: "NDWI - Water", description: "Open water bodies", color: "#1971c2", formula: "(G - NIR)/(G + NIR)" },
water_mndwi: { name: "MNDWI - Urban Water", description: "Water in urban areas", color: "#1864ab", formula: "(G - SWIR)/(G + SWIR)" },
water_awei: { name: "AWEI - Automated", description: "Shadow suppression", color: "#0b7285", formula: "4(G-SWIR)-(0.25NIR+2.75SWIR2)" },
vegetation_ndvi: { name: "NDVI - Vegetation", description: "Plant health", color: "#2f9e44", formula: "(NIR - R)/(NIR + R)" },
vegetation_evi: { name: "EVI - Enhanced Veg", description: "Dense canopy", color: "#5c940d", formula: "2.5(NIR-R)/(NIR+6R-7.5B+1)" },
buildings_ndbi: { name: "NDBI - Built-up", description: "Urban structures", color: "#c92a2a", formula: "(SWIR - NIR)/(SWIR + NIR)" },
baresoil_bsi: { name: "BSI - Bare Soil", description: "Soil detection", color: "#d9480f", formula: "((SWIR+R)-(NIR+B))/((SWIR+R)+(NIR+B))" }
};
export default function AdvancedAnalysisModal({ opened, onClose, onRunCompare, isLoading, isError, results }) {
const [modelA, setModelA] = useState('terramind_v1_small_generate');
const [modelB, setModelB] = useState('terramind_v1_large_generate');
const modelOptions = [
{ value: 'terramind_v1_tiny_generate', label: 'Terramind v1 Tiny' },
{ value: 'terramind_v1_small_generate', label: 'Terramind v1 Small' },
{ value: 'terramind_v1_base_generate', label: 'Terramind v1 Base' },
{ value: 'terramind_v1_large_generate', label: 'Terramind v1 Large' },
];
const getModelLabel = (model) => {
const parts = model.split('_');
return parts[2] ? parts[2].toUpperCase() + " Model" : model;
};
return (