diff --git a/src/routes/(public)/explore/cubes/[slug]/+page.svelte b/src/routes/(public)/explore/cubes/[slug]/+page.svelte index 32611887..783bf0fd 100644 --- a/src/routes/(public)/explore/cubes/[slug]/+page.svelte +++ b/src/routes/(public)/explore/cubes/[slug]/+page.svelte @@ -23,6 +23,29 @@ const presentFeatures = $derived.by(() => allFeatureBadges.filter((b) => features.includes(b.key)) ); + + const missingFields = $derived.by(() => { + const missing: string[] = []; + const trackIfMissing = (value: unknown, label: string) => { + if ( + value === null || + value === undefined || + (typeof value === "string" && value.trim() === "") + ) { + missing.push(label); + } + }; + + trackIfMissing(cube.brand, "Brand"); + trackIfMissing(cube.type, "Type"); + trackIfMissing(cube.release_date, "Release date"); + trackIfMissing(cube.weight, "Weight"); + trackIfMissing(cube.size, "Size"); + trackIfMissing(cube.surface_finish, "Surface finish"); + trackIfMissing(cube.image_url, "Image"); + + return missing; + }); @@ -40,6 +63,24 @@
+ {#if missingFields.length > 0} +
+ +
+

Some cube details are missing

+

+ Missing: + {missingFields.join(", ")}. Have these details? Let us know so we can + fill them in. +

+
+
+ {/if} +

About