Migrate grateWizard from React/Next.js to native Nuxt integration
- Port all React components to Vue 3 (GwTabs, GwMN, GwCRA, GwCRS, GwMap, GwRelations, GwPerimeterList) - Port hooks to Vue composables (useCesiumProfiles, useSavedPerimeters) - Copy pure TS services and utils (duniter/, ss58, gratewizard utils) - Add Leaflet + Geoman + MarkerCluster dependencies - Serve grateWizard as popup via /gratewizard?popup (layout: false) and info page on /gratewizard (with Librodrome layout) - Remove public/gratewizard-app/ static Next.js export - Refine UI: compact tabs, buttons, inputs, cards, perimeter list - Use Ğ1 breve everywhere, French locale for all dates and amounts - Rename roles: vendeur→offre / acheteur→reçoit le produit ou service - Rename prix→évaluation in all visible text - Add calculated result column in CRA and CRS relation tables - DU/Ğ1 selector uses toggle switch (same as role toggle) - Auto-scroll to monetary data card on polygon selection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
24
app/composables/useSavedPerimeters.ts
Normal file
24
app/composables/useSavedPerimeters.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export type SavedPerimeter = {
|
||||
name: string;
|
||||
polygon: [number, number][];
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'gw-saved-perimeters';
|
||||
|
||||
export function useSavedPerimeters() {
|
||||
const perimeters = useLocalStorage<SavedPerimeter[]>(STORAGE_KEY, []);
|
||||
|
||||
function savePerimeter(name: string, polygon: [number, number][]) {
|
||||
perimeters.value = [
|
||||
...perimeters.value.filter((p) => p.name !== name),
|
||||
{ name, polygon, createdAt: new Date().toISOString() },
|
||||
];
|
||||
}
|
||||
|
||||
function deletePerimeter(name: string) {
|
||||
perimeters.value = perimeters.value.filter((p) => p.name !== name);
|
||||
}
|
||||
|
||||
return { perimeters, savePerimeter, deletePerimeter };
|
||||
}
|
||||
Reference in New Issue
Block a user