|
| 1 | +// Noms officiels des départements (INSEE), figés côté client : donnée stable, |
| 2 | +// évite de charger un GeoJSON juste pour libeller un <select>. Les codes |
| 3 | +// absents (collectivités hors périmètre DVF) retombent sur le code brut. |
| 4 | + |
| 5 | +export const DEPARTEMENT_NOMS: Record<string, string> = { |
| 6 | + "01": "Ain", |
| 7 | + "02": "Aisne", |
| 8 | + "03": "Allier", |
| 9 | + "04": "Alpes-de-Haute-Provence", |
| 10 | + "05": "Hautes-Alpes", |
| 11 | + "06": "Alpes-Maritimes", |
| 12 | + "07": "Ardèche", |
| 13 | + "08": "Ardennes", |
| 14 | + "09": "Ariège", |
| 15 | + "10": "Aube", |
| 16 | + "11": "Aude", |
| 17 | + "12": "Aveyron", |
| 18 | + "13": "Bouches-du-Rhône", |
| 19 | + "14": "Calvados", |
| 20 | + "15": "Cantal", |
| 21 | + "16": "Charente", |
| 22 | + "17": "Charente-Maritime", |
| 23 | + "18": "Cher", |
| 24 | + "19": "Corrèze", |
| 25 | + "2A": "Corse-du-Sud", |
| 26 | + "2B": "Haute-Corse", |
| 27 | + "21": "Côte-d'Or", |
| 28 | + "22": "Côtes-d'Armor", |
| 29 | + "23": "Creuse", |
| 30 | + "24": "Dordogne", |
| 31 | + "25": "Doubs", |
| 32 | + "26": "Drôme", |
| 33 | + "27": "Eure", |
| 34 | + "28": "Eure-et-Loir", |
| 35 | + "29": "Finistère", |
| 36 | + "30": "Gard", |
| 37 | + "31": "Haute-Garonne", |
| 38 | + "32": "Gers", |
| 39 | + "33": "Gironde", |
| 40 | + "34": "Hérault", |
| 41 | + "35": "Ille-et-Vilaine", |
| 42 | + "36": "Indre", |
| 43 | + "37": "Indre-et-Loire", |
| 44 | + "38": "Isère", |
| 45 | + "39": "Jura", |
| 46 | + "40": "Landes", |
| 47 | + "41": "Loir-et-Cher", |
| 48 | + "42": "Loire", |
| 49 | + "43": "Haute-Loire", |
| 50 | + "44": "Loire-Atlantique", |
| 51 | + "45": "Loiret", |
| 52 | + "46": "Lot", |
| 53 | + "47": "Lot-et-Garonne", |
| 54 | + "48": "Lozère", |
| 55 | + "49": "Maine-et-Loire", |
| 56 | + "50": "Manche", |
| 57 | + "51": "Marne", |
| 58 | + "52": "Haute-Marne", |
| 59 | + "53": "Mayenne", |
| 60 | + "54": "Meurthe-et-Moselle", |
| 61 | + "55": "Meuse", |
| 62 | + "56": "Morbihan", |
| 63 | + "57": "Moselle", |
| 64 | + "58": "Nièvre", |
| 65 | + "59": "Nord", |
| 66 | + "60": "Oise", |
| 67 | + "61": "Orne", |
| 68 | + "62": "Pas-de-Calais", |
| 69 | + "63": "Puy-de-Dôme", |
| 70 | + "64": "Pyrénées-Atlantiques", |
| 71 | + "65": "Hautes-Pyrénées", |
| 72 | + "66": "Pyrénées-Orientales", |
| 73 | + "67": "Bas-Rhin", |
| 74 | + "68": "Haut-Rhin", |
| 75 | + "69": "Rhône", |
| 76 | + "70": "Haute-Saône", |
| 77 | + "71": "Saône-et-Loire", |
| 78 | + "72": "Sarthe", |
| 79 | + "73": "Savoie", |
| 80 | + "74": "Haute-Savoie", |
| 81 | + "75": "Paris", |
| 82 | + "76": "Seine-Maritime", |
| 83 | + "77": "Seine-et-Marne", |
| 84 | + "78": "Yvelines", |
| 85 | + "79": "Deux-Sèvres", |
| 86 | + "80": "Somme", |
| 87 | + "81": "Tarn", |
| 88 | + "82": "Tarn-et-Garonne", |
| 89 | + "83": "Var", |
| 90 | + "84": "Vaucluse", |
| 91 | + "85": "Vendée", |
| 92 | + "86": "Vienne", |
| 93 | + "87": "Haute-Vienne", |
| 94 | + "88": "Vosges", |
| 95 | + "89": "Yonne", |
| 96 | + "90": "Territoire de Belfort", |
| 97 | + "91": "Essonne", |
| 98 | + "92": "Hauts-de-Seine", |
| 99 | + "93": "Seine-Saint-Denis", |
| 100 | + "94": "Val-de-Marne", |
| 101 | + "95": "Val-d'Oise", |
| 102 | + "971": "Guadeloupe", |
| 103 | + "972": "Martinique", |
| 104 | + "973": "Guyane", |
| 105 | + "974": "La Réunion", |
| 106 | + "976": "Mayotte", |
| 107 | +} |
| 108 | + |
| 109 | +/** Libellé « 94 — Val-de-Marne » pour les <select> ; code seul si inconnu. */ |
| 110 | +export function departementLabel(code: string): string { |
| 111 | + const nom = DEPARTEMENT_NOMS[code] |
| 112 | + return nom ? `${code} — ${nom}` : code |
| 113 | +} |
0 commit comments