Skip to content

Commit

Permalink
feat: add reinit filter button
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Dec 17, 2024
1 parent ce24b49 commit 6813749
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions app/projets/_components/CommunesFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,30 @@ export function CommunesFilter({
}

return (
<div className="mb-12">
<div className="mb-10">
<label htmlFor="commune-select" className="block mb-2 font-medium">
Filtrer sur une commune :
</label>
<select
id="commune-select"
className="fr-select w-full max-w-xs"
onChange={handleChange}
value={codeCommune || ""}
>
<option value="">-- Toutes les communes --</option>
{communes.map((commune) => (
<option key={commune.code} value={commune.code}>
{commune.nom}
</option>
))}
</select>
<div className="flex flex-wrap items-center gap-x-4">
<select
id="commune-select"
className="fr-select w-full max-w-xs mb-0"
onChange={handleChange}
value={codeCommune || ""}
>
<option value="">-- Toutes les communes --</option>
{communes.map((commune) => (
<option key={commune.code} value={commune.code}>
{commune.nom}
</option>
))}
</select>
{codeCommune && (
<a className="fr-link block" href={`/projets/${codeDepartement}`}>
Réinitialiser
</a>
)}
</div>
</div>
);
}

0 comments on commit 6813749

Please sign in to comment.