Skip to content

Commit

Permalink
Fix clear button for CNS location filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Nov 10, 2023
1 parent c67ced2 commit 7cfda46
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/Components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,22 @@ export default function CentralNursingStation({ facilityId }: Props) {
<FieldLabel className="text-sm">
Filter by Location
</FieldLabel>
<div className="flex w-full items-center gap-2">
<div>
<LocationSelect
key={qParams.location}
name="Facilities"
setSelected={(location) => updateQuery({ location })}
setSelected={(location) => {
location
? updateQuery({ location })
: removeFilter("location");
}}
selected={qParams.location}
showAll={false}
multiple={false}
facilityId={facilityId}
errors=""
errorClassName="hidden"
/>
{qParams.location && (
<ButtonV2
variant="secondary"
circle
border
onClick={() => removeFilter("location")}
>
Clear
</ButtonV2>
)}
</div>
</div>
<SelectFormField
Expand Down

0 comments on commit 7cfda46

Please sign in to comment.