diff --git a/src/app/apps/page.tsx b/src/app/apps/page.tsx index 5fe23c3..9d2144c 100644 --- a/src/app/apps/page.tsx +++ b/src/app/apps/page.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { type FormEvent, + type ReactNode, useCallback, useEffect, useMemo, @@ -349,6 +350,104 @@ function getTemplateVisual(template: AppTemplate | null) { }; } +function normalizeExternalUrl(value?: string) { + const trimmed = value?.trim(); + if (!trimmed) return ""; + + if (/^https?:\/\//i.test(trimmed)) { + return trimmed; + } + + return `https://${trimmed}`; +} + +function getTemplateLinks(template: AppTemplate) { + return { + github: normalizeExternalUrl(template.presentation?.github), + dockerHub: normalizeExternalUrl(template.presentation?.["hub-docker"]), + }; +} + +function SimpleIcon({ + src, + label, + size, +}: { + src: string; + label: string; + size: number; +}) { + return ( + // eslint-disable-next-line @next/next/no-img-element + {label} + ); +} + +function MaskIcon({ + src, + size, +}: { + src: string; + size: number; +}) { + return ( +