Spaces:
Sleeping
Sleeping
Download frontend/src/components/analysis/ProcessMapPreview.tsx from DAG-UPB/HeatTransPlan: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/components/analysis/ProcessMapPreview.tsx
- Command line
-
hf download hf://spaces/DAG-UPB/HeatTransPlan/frontend/src/components/analysis/ProcessMapPreview.tsx
-
curl -L -o ProcessMapPreview.tsx https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/components/analysis/ProcessMapPreview.tsx
1.04 kB
| /** ProcessMapPreview — shows the stored map snapshot image. */ | |
| import { useProjectStore } from '../../store/projectStore'; | |
| interface Props { | |
| imgData?: string | null; | |
| } | |
| export default function ProcessMapPreview({ imgData: propImgData }: Props) { | |
| const snapshots = useProjectStore((s) => s.state.map_snapshots_encoded); | |
| const currentBase = useProjectStore((s) => s.state.current_base); | |
| const imgData = propImgData ?? snapshots?.[currentBase ?? 'OpenStreetMap'] | |
| ?? (snapshots ? Object.values(snapshots)[0] : null); | |
| if (!imgData) { | |
| return ( | |
| <div className="pa-panel"> | |
| <h4 className="pa-panel-title">🗺️ Georeferencing</h4> | |
| <div className="pa-info-box">Map not available. Lock a map in Data Collection first.</div> | |
| </div> | |
| ); | |
| } | |
| return ( | |
| <div className="pa-panel"> | |
| <h4 className="pa-panel-title">🗺️ Georeferencing</h4> | |
| <img | |
| src={`data:image/png;base64,${imgData}`} | |
| alt="Process map" | |
| className="pa-map-img" | |
| /> | |
| </div> | |
| ); | |
| } | |