diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index 2ccbd3795..2fc310a8f 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -2309,6 +2309,7 @@ "openProjectPage": "Open Project Page", "openReleasePage": "Open Release Page", "releaseDescription": "Release Description", + "projectDescription": "Project Description", "created": "Created", "error": { "label": "Error", diff --git a/packages/widgets/src/releases/component.tsx b/packages/widgets/src/releases/component.tsx index d6f421621..bbde6d212 100644 --- a/packages/widgets/src/releases/component.tsx +++ b/packages/widgets/src/releases/component.tsx @@ -18,7 +18,7 @@ import ReactMarkdown from "react-markdown"; import { clientApi } from "@homarr/api/client"; import { useRequiredBoard } from "@homarr/boards/context"; -import { isDateWithin, splitToChunksWithNItems } from "@homarr/common"; +import { isDateWithin, isNullOrWhitespace, splitToChunksWithNItems } from "@homarr/common"; import { useScopedI18n } from "@homarr/translation/client"; import { MaskedOrNormalImage } from "@homarr/ui"; @@ -572,23 +572,39 @@ const ExpandedDisplay = ({ repository, hasIconColor }: ExtendedDisplayProps) => )} - {repository.releaseDescription && ( - <> - - - {t("releaseDescription")} - - - {repository.releaseDescription} - - + + {repository.releaseDescription ? ( + + ) : ( + )} ); }; + +interface DescriptionProps { + title: string; + description: string | null; +} + +const Description = ({ title, description }: DescriptionProps) => { + if (isNullOrWhitespace(description)) return null; + + return ( + <> + + + {title} + + + {description} + + + ); +};