-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): ajout du filtre UAI (connu ou inconnu) (#3278)
- Loading branch information
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { CheckboxGroup, Stack, Checkbox } from "@chakra-ui/react"; | ||
import { useState } from "react"; | ||
|
||
import SimpleOverlayMenu from "@/modules/dashboard/SimpleOverlayMenu"; | ||
|
||
import { OrganismesFilterButton } from "./OrganismesFilterButton"; | ||
|
||
interface FiltreOrganismeUaiProps { | ||
value: boolean[]; | ||
onChange: (value: boolean[]) => void; | ||
} | ||
|
||
function FiltreOrganismeUai(props: FiltreOrganismeUaiProps) { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const etatUAI = props.value; | ||
|
||
return ( | ||
<div> | ||
<OrganismesFilterButton isOpen={isOpen} setIsOpen={setIsOpen} buttonLabel="UAI" badge={etatUAI?.length} /> | ||
{isOpen && ( | ||
<SimpleOverlayMenu onClose={() => setIsOpen(false)} width="auto" p="3w"> | ||
<CheckboxGroup | ||
value={props.value?.map((item) => item.toString())} | ||
onChange={(value) => props.onChange(value.map((v: string) => (v === "true" ? true : false)))} | ||
> | ||
<Stack> | ||
<Checkbox value="true" key="connu" fontSize="mini" size="sm"> | ||
Connu | ||
</Checkbox> | ||
<Checkbox value="false" key="inconnu" fontSize="mini" size="sm"> | ||
Inconnu | ||
</Checkbox> | ||
</Stack> | ||
</CheckboxGroup> | ||
</SimpleOverlayMenu> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default FiltreOrganismeUai; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters