1+ import type { ComponentType } from "react" ;
12import Link from "next/link" ;
3+ import { PRODUCTS } from "@/src/data/products" ;
24import { Typography } from "@/src/design-system/Typography" ;
5+ import { Fusion } from "@/src/icons/Fusion" ;
6+ import { HotChocolate } from "@/src/icons/HotChocolate" ;
7+ import { Mocha } from "@/src/icons/Mocha" ;
8+ import { Nitro } from "@/src/icons/Nitro" ;
9+ import { Skillz } from "@/src/icons/Skillz" ;
10+ import { StrawberryShake } from "@/src/icons/StrawberryShake" ;
311
412export const metadata = {
513 title : "Documentation" ,
614 description : "Documentation for the ChilliCream GraphQL Platform." ,
715} ;
816
9- const PRODUCTS = [
10- { slug : "hotchocolate" , label : "Hot Chocolate" } ,
11- { slug : "fusion" , label : "Fusion" } ,
12- { slug : "strawberryshake" , label : "Strawberry Shake" } ,
13- { slug : "nitro" , label : "Nitro" } ,
14- { slug : "mocha" , label : "Mocha" } ,
15- { slug : "skillz" , label : "Skillz" } ,
16- ] ;
17+ type ProductIcon = ComponentType < { className ?: string } > ;
18+
19+ const PRODUCT_ICONS : Record < string , ProductIcon > = {
20+ hotchocolate : HotChocolate ,
21+ fusion : Fusion ,
22+ strawberryshake : StrawberryShake ,
23+ nitro : Nitro ,
24+ mocha : Mocha ,
25+ skillz : Skillz ,
26+ } ;
1727
1828export default function DocsIndex ( ) {
1929 return (
@@ -23,18 +33,30 @@ export default function DocsIndex() {
2333 < p className = "text-cc-ink-dim" >
2434 Pick a product to get started. More content is on its way.
2535 </ p >
26- < ul className = "mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2" >
27- { PRODUCTS . map ( ( p ) => (
28- < li key = { p . slug } >
29- < Link
30- href = { `/docs/${ p . slug } ` }
31- className = "border-cc-card-border text-cc-ink hover:border-cc-accent hover:text-cc-accent block rounded-md border p-4 no-underline transition-colors"
32- >
33- < div className = "font-medium" > { p . label } </ div >
34- < div className = "text-cc-ink-dim text-sm" > /docs/{ p . slug } </ div >
35- </ Link >
36- </ li >
37- ) ) }
36+ < ul className = "mt-8 grid grid-cols-1 gap-4 sm:grid-cols-2" >
37+ { PRODUCTS . map ( ( product ) => {
38+ const Icon = PRODUCT_ICONS [ product . slug ] ;
39+ return (
40+ < li key = { product . slug } >
41+ < Link
42+ href = { `/docs/${ product . slug } ` }
43+ className = "border-cc-card-border bg-cc-card-bg/60 hover:border-cc-accent group flex h-full items-center gap-4 rounded-2xl border p-5 no-underline transition-colors"
44+ >
45+ < span className = "bg-cc-hover ring-cc-card-border flex h-14 w-14 flex-none items-center justify-center rounded-xl ring-1" >
46+ { Icon ? < Icon className = "h-8 w-8" /> : null }
47+ </ span >
48+ < span className = "flex flex-col" >
49+ < span className = "font-heading text-cc-heading text-lg font-semibold" >
50+ { product . title }
51+ </ span >
52+ < span className = "text-cc-ink-dim text-sm" >
53+ { product . description }
54+ </ span >
55+ </ span >
56+ </ Link >
57+ </ li >
58+ ) ;
59+ } ) }
3860 </ ul >
3961 </ div >
4062 </ div >
0 commit comments