File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import type { Metadata } from "next";
88import Link from "next/link" ;
99import { getCategoryThumbnail } from "@/components/category-thumbnails" ;
1010import { categories } from "@/config/categories" ;
11+ import { PAGES_NEW } from "@/lib/docs" ;
12+ import { Badge } from "@/registry/default/ui/badge" ;
1113import { Button } from "@/registry/default/ui/button" ;
1214import {
1315 Card ,
@@ -88,6 +90,7 @@ function CategoryCard({
8890 thumbnail,
8991} : CategoryCardProps ) {
9092 const href = `/docs/components/${ slug } ` ;
93+ const isNew = PAGES_NEW . includes ( href ) ;
9194
9295 return (
9396 < CardFrame className = "after:-inset-[5px] after:-z-1 w-full after:pointer-events-none after:absolute after:rounded-[calc(var(--radius-xl)+4px)] after:border after:border-border/64" >
@@ -110,6 +113,11 @@ function CategoryCard({
110113 </ CardFrameDescription >
111114 </ CardFrameHeader >
112115 < Card className = "pointer-events-none min-h-55 flex-1 flex-col flex-wrap overflow-x-auto bg-[color-mix(in_srgb,var(--color-card),var(--color-sidebar))] dark:bg-background" >
116+ { isNew && (
117+ < Badge className = "absolute end-3 top-3" variant = "info" >
118+ New
119+ </ Badge >
120+ ) }
113121 < CardPanel className = "flex flex-1 items-center justify-center px-8 [--border:--alpha(var(--color-black)/7%)] [--btn-from:--alpha(var(--color-primary)/90%)] [--btn-to:var(--color-primary)] in-[[data-slot=card-frame]:has(a:not(:hover))]:*:translate-y-0.5 *:transition-transform *:duration-200 dark:[--border:--alpha(var(--color-white)/3%)] dark:[--btn-from:var(--color-primary)] dark:[--btn-to:--alpha(var(--color-primary)/90%)]" >
114122 { thumbnail }
115123 </ CardPanel >
You can’t perform that action at this time.
0 commit comments