@@ -7,14 +7,16 @@ import {
7
7
SelectItem ,
8
8
} from "@/components/ui/select" ;
9
9
import { memo } from "react" ;
10
- import { FlaskConical , CalendarDays } from "lucide-react" ;
10
+ import { FlaskConical , CalendarDays , Diamond } from "lucide-react" ;
11
11
import { availableCategories , ICategory } from "@/lib/polluants" ;
12
12
13
13
type PollutionMapFiltersProps = {
14
14
period : string ;
15
15
setPeriod : ( year : string ) => void ;
16
16
category : string ;
17
17
setCategory : ( type : string ) => void ;
18
+ displayMode : "communes" | "udis" ;
19
+ setDisplayMode : ( mode : "communes" | "udis" ) => void ;
18
20
} ;
19
21
20
22
type CategoryItemsProps = {
@@ -67,6 +69,8 @@ export default function PollutionMapFilters({
67
69
setPeriod,
68
70
category,
69
71
setCategory,
72
+ displayMode,
73
+ setDisplayMode,
70
74
} : PollutionMapFiltersProps ) {
71
75
const availablePeriods = [
72
76
{ value : "dernier_prel" , label : "Dernière analyse" } ,
@@ -78,6 +82,11 @@ export default function PollutionMapFilters({
78
82
{ value : "bilan_annuel_2020" , label : "Bilan 2020" } ,
79
83
] ;
80
84
85
+ const availableDisplayModes = [
86
+ { value : "udis" as const , label : "Réseaux d'eau" } ,
87
+ { value : "communes" as const , label : "Communes" } ,
88
+ ] ;
89
+
81
90
return (
82
91
< div className = "flex space-x-6 p-2" >
83
92
< div className = "shadow-sm" >
@@ -117,6 +126,27 @@ export default function PollutionMapFilters({
117
126
</ SelectContent >
118
127
</ Select >
119
128
</ div >
129
+
130
+ < div className = "shadow-sm" >
131
+ < Select value = { displayMode } onValueChange = { setDisplayMode } >
132
+ < SelectTrigger
133
+ className = "bg-white rounded-2xl"
134
+ aria-label = "display-mode-select"
135
+ >
136
+ < Diamond size = { 16 } className = "text-gray-400" />
137
+ < div className = "block mx-1" >
138
+ < SelectValue placeholder = "Affichage" className = "mx-1" />
139
+ </ div >
140
+ </ SelectTrigger >
141
+ < SelectContent className = "rounded-xl" >
142
+ { availableDisplayModes . map ( ( mode ) => (
143
+ < SelectItem key = { mode . value } value = { mode . value } >
144
+ { mode . label }
145
+ </ SelectItem >
146
+ ) ) }
147
+ </ SelectContent >
148
+ </ Select >
149
+ </ div >
120
150
</ div >
121
151
) ;
122
152
}
0 commit comments