@@ -8,7 +8,7 @@ interface Stat {
88 suffix ?: string ;
99}
1010
11- const STATS : Stat [ ] = [
11+ const DEFAULT_STATS : Stat [ ] = [
1212 { value : 5 , label : 'Templates' } ,
1313 { value : 12 , label : 'Extensions' } ,
1414 { value : 9 , label : 'Categories' } ,
@@ -47,11 +47,26 @@ function Counter({ target, duration = 1200 }: { target: number; duration?: numbe
4747 return < span ref = { ref } > { count } </ span > ;
4848}
4949
50- export function StatsBar ( ) {
50+ export function StatsBar ( {
51+ templates,
52+ extensions,
53+ categories,
54+ } : {
55+ templates ?: number ;
56+ extensions ?: number ;
57+ categories ?: number ;
58+ } = { } ) {
59+ const stats : Stat [ ] = [
60+ { value : templates ?? ( DEFAULT_STATS [ 0 ] . value as number ) , label : 'Templates' } ,
61+ { value : extensions ?? ( DEFAULT_STATS [ 1 ] . value as number ) , label : 'Extensions' } ,
62+ { value : categories ?? ( DEFAULT_STATS [ 2 ] . value as number ) , label : 'Categories' } ,
63+ { value : 'MIT' , label : 'Licensed' } ,
64+ ] ;
65+
5166 return (
5267 < div className = "w-full border-y border-border/50 bg-muted/20" >
5368 < div className = "container flex flex-wrap items-center justify-center gap-x-10 gap-y-4 py-6 md:gap-x-16" >
54- { STATS . map ( ( stat ) => (
69+ { stats . map ( ( stat ) => (
5570 < div key = { stat . label } className = "flex flex-col items-center gap-0.5" >
5671 < span className = "font-display text-2xl font-bold text-foreground md:text-3xl" >
5772 { typeof stat . value === 'number' ? < Counter target = { stat . value } /> : stat . value }
0 commit comments