Merge pull request #2219 from mtdvlpr/main

fix(templates): don't show section when all items are hidden
This commit is contained in:
Amruth Pillai
2025-10-01 11:30:33 +02:00
committed by GitHub
12 changed files with 12 additions and 12 deletions

View File

@ -186,7 +186,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -177,7 +177,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid grid-cols-5 border-t pt-2.5"> <section id={section.id} className="grid grid-cols-5 border-t pt-2.5">

View File

@ -182,7 +182,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -197,7 +197,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -184,7 +184,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -192,7 +192,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -196,7 +196,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -191,7 +191,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -180,7 +180,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}> <section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}>

View File

@ -197,7 +197,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -212,7 +212,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">

View File

@ -178,7 +178,7 @@ const Section = <T,>({
summaryKey, summaryKey,
keywordsKey, keywordsKey,
}: SectionProps<T>) => { }: 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 ( return (
<section id={section.id} className="grid"> <section id={section.id} className="grid">