Skip to content

Commit

Permalink
feat: display message for empty collapses (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
diogogmatos authored Aug 26, 2024
1 parent bae7f46 commit 5c931d3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/FilterBlock/FilterBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ const FilterBlock = ({
}) => {
return (
<>
{shifts &&
shifts.length > 0 &&
{shifts && shifts.length > 0 ? (
shifts.map((item) => (
<Fragment key={id.toString() + item + "Checkbox"}>
<div>
Expand All @@ -217,7 +216,10 @@ const FilterBlock = ({
</Checkbox>
</div>
</Fragment>
))}
))
) : (
<p className="text-neutral-400">Information not available.</p>
)}
</>
);
};
Expand Down Expand Up @@ -317,7 +319,7 @@ const FilterBlock = ({
>
{checkBoxes[index1 * layer2.length + index2] &&
checkBoxes[index1 * layer2.length + index2].some(
(item) => item.shifts
(item) => item.shifts && item.shifts.length > 0
) ? (
<>
{checkBoxes[
Expand All @@ -341,6 +343,12 @@ const FilterBlock = ({
</Fragment>
))}
</>
) : checkBoxes[
index1 * layer2.length + index2
].some((item) => item.shifts) ? (
<p className="text-neutral-400">
Information not available.
</p>
) : (
<>
<SelectAll
Expand Down

0 comments on commit 5c931d3

Please sign in to comment.