Extract dataset presentational components
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-17 04:04:20 +02:00
parent 57e9d44e85
commit 1cbb356220
11 changed files with 888 additions and 385 deletions
@@ -0,0 +1,65 @@
import type { AreaRead, DatasetCreateResponse } from '../../types'
interface VectorControlsProps {
areas: AreaRead[]
availableVectorTargets: DatasetCreateResponse[]
selectedClipAreaId: string
selectedIntersectTargetId: string
onSetSelectedClipAreaId: (value: string) => void
onSetSelectedIntersectTargetId: (value: string) => void
onRunVectorClip: () => void
onRunVectorBuffer: () => void
onRunVectorIntersect: () => void
}
export function VectorControls({
areas,
availableVectorTargets,
selectedClipAreaId,
selectedIntersectTargetId,
onSetSelectedClipAreaId,
onSetSelectedIntersectTargetId,
onRunVectorClip,
onRunVectorBuffer,
onRunVectorIntersect,
}: VectorControlsProps) {
return (
<div>
<h3>Vector operations</h3>
<div>
<label>
Clip area
<select value={selectedClipAreaId} onChange={(event) => onSetSelectedClipAreaId(event.target.value)}>
{areas.map((area) => (
<option key={area.id} value={area.id}>
{area.name}
</option>
))}
</select>
</label>
<button type="button" onClick={onRunVectorClip} disabled={areas.length === 0}>
Run clip
</button>
</div>
<button type="button" onClick={onRunVectorBuffer}>
Run buffer (25m)
</button>
<div>
<label>
Intersect target
<select value={selectedIntersectTargetId} onChange={(event) => onSetSelectedIntersectTargetId(event.target.value)}>
<option value="">auto first vector</option>
{availableVectorTargets.map((target) => (
<option key={target.id} value={target.id}>
{target.name}
</option>
))}
</select>
</label>
<button type="button" onClick={onRunVectorIntersect}>
Run intersect
</button>
</div>
</div>
)
}