From e204342a61503ecd24a5fc52ae8731f6ed0e1f14 Mon Sep 17 00:00:00 2001 From: Camiel van Schoonhoven Date: Fri, 28 Aug 2026 16:07:50 -0700 Subject: [PATCH] refactor(InfoBox): allow a body-only box A notice may carry only a body, with no title. Rendering an empty Text still reserved its margin, so the box opened with a blank line above the content. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/shared/InfoBox.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/shared/InfoBox.tsx b/src/components/shared/InfoBox.tsx index 9b0e11be48..52677cf5d4 100644 --- a/src/components/shared/InfoBox.tsx +++ b/src/components/shared/InfoBox.tsx @@ -7,7 +7,7 @@ import { Text } from "@/components/ui/typography"; import { cn } from "@/lib/utils"; interface InfoBoxProps { - title: string; + title?: string; width?: "full" | "fit" | "auto"; className?: string; children: ReactNode; @@ -67,15 +67,17 @@ export const InfoBox = ({ className={cn("border rounded-md p-2", styles.container, widthClass)} > - - {title} - + {title && ( + + {title} + + )} {onDismiss && (