fix(templates): don't show section when all items are hidden

This commit is contained in:
Manoah Tervoort
2025-02-21 11:00:09 +01:00
parent cd21860535
commit 8efc243e43
12 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -177,7 +177,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid grid-cols-5 border-t pt-2.5">
+1 -1
View File
@@ -182,7 +182,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -197,7 +197,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -184,7 +184,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -192,7 +192,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -196,7 +196,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -191,7 +191,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -180,7 +180,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}>
+1 -1
View File
@@ -197,7 +197,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -212,7 +212,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">
+1 -1
View File
@@ -178,7 +178,7 @@ const Section = <T,>({
summaryKey,
keywordsKey,
}: SectionProps<T>) => {
if (!section.visible || section.items.length === 0) return null;
if (!section.visible || section.items.filter((item) => item.visible).length === 0) return null;
return (
<section id={section.id} className="grid">