import { useAtlasStore } from "../store/useAtlasStore.js"; import type { Structure } from "../lib/api.js"; export function StructureInfoPanel({ bySlug, onClose, }: { bySlug: Map; // No desktop o painel é uma gaveta lateral sempre visível (não faz // sentido "fechar", só trocar de estrutura), então esse botão só existe // quando a página que usa o painel passa um onClose — hoje é o caso da // bottom sheet do Atlas no mobile. onClose?: () => void; }) { const selectedStructureId = useAtlasStore((s) => s.selectedStructureId); const selectStructure = useAtlasStore((s) => s.selectStructure); const structure = selectedStructureId ? [...bySlug.values()].find((s) => s.id === selectedStructureId) : null; if (!structure) { return (
Clique em uma estrutura no modelo 3D para ver os detalhes aqui.
); } function handleClose() { selectStructure(null); onClose?.(); } return (

{structure.namePt}

{structure.nameEn}

{structure.system.namePt} {structure.description && (

{structure.description}

)} {structure.regionPath.length > 0 && (

{structure.regionPath.join(" › ")}

)} {structure.synonyms.length > 0 && (

Sinônimos: {structure.synonyms.join(", ")}

)}
); }