feat: hide sections when empty by default

This commit is contained in:
sarendsen
2025-01-24 08:59:41 +01:00
parent dac471f0a6
commit c4a83e283f
2 changed files with 3 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ export const ScrollingCollectionList: React.FC<Props> = ({
disabled = false,
queryFn,
queryKey,
hideIfEmpty = false,
hideIfEmpty = true,
...props
}) => {
const { data, isLoading } = useQuery({
@@ -42,8 +42,7 @@ export const ScrollingCollectionList: React.FC<Props> = ({
const { t } = useTranslation();
// hideIfEmpty is deprecated, we always hide when there is no data
if (hideIfEmpty === true || data?.length === 0) return null;
if (hideIfEmpty === true && data?.length === 0) return null;
if (disabled || !title) return null;
return (