cfahlgren1 HF staff commited on
Commit
bf3b742
1 Parent(s): 2fe081d

add demo type

Browse files
.github/workflows/deploy.yml CHANGED
@@ -30,4 +30,4 @@ jobs:
30
 
31
  - name: Push to Hugging Face Spaces
32
  run: |
33
- git push hf main || echo "No changes to deploy."
 
30
 
31
  - name: Push to Hugging Face Spaces
32
  run: |
33
+ git push hf +main || echo "Failed to deploy."
components/category/CategoryContent.tsx CHANGED
@@ -89,10 +89,30 @@ function DemoCards({ category, colorConfig }: { category: Category; colorConfig:
89
 
90
  return (
91
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
92
- {category.demos.map((Demo, index) => (
93
- <div key={index} className={cn("rounded-lg shadow-md p-6", colorConfig.bg)}>
94
- <Demo />
95
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  ))}
97
  </div>
98
  );
 
89
 
90
  return (
91
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
92
+ {category.demos.map((demo, index) => (
93
+ <Link
94
+ key={index}
95
+ href={`/category/${category.slug}/${demo.slug}`}
96
+ className={cn(
97
+ "block rounded-lg shadow-md p-6 transition-all duration-300",
98
+ colorConfig.bg,
99
+ "hover:shadow-lg hover:-translate-y-1"
100
+ )}
101
+ >
102
+ <h3 className={cn("text-xl font-bold mb-2", colorConfig.text)}>
103
+ {demo.title}
104
+ </h3>
105
+ <p className="text-sm text-gray-600 mb-4">
106
+ {demo.description}
107
+ </p>
108
+ <span className={cn(
109
+ "inline-block px-3 py-1 text-sm font-semibold rounded-full",
110
+ colorConfig.text,
111
+ colorConfig.bg
112
+ )}>
113
+ View Demo
114
+ </span>
115
+ </Link>
116
  ))}
117
  </div>
118
  );
types/categories.ts CHANGED
@@ -2,6 +2,14 @@ import type { LucideIcon } from 'lucide-react';
2
 
3
  export type CategoryStatus = 'New' | 'Coming Soon' | 'Available';
4
 
 
 
 
 
 
 
 
 
5
  export interface Category {
6
  title: string;
7
  slug: string;
@@ -10,5 +18,5 @@ export interface Category {
10
  status: CategoryStatus;
11
  colorName: string;
12
  graphic: React.ComponentType<React.SVGProps<SVGSVGElement>>;
13
- demos?: React.ComponentType[];
14
  }
 
2
 
3
  export type CategoryStatus = 'New' | 'Coming Soon' | 'Available';
4
 
5
+ export interface Demo {
6
+ component: React.ComponentType;
7
+ title: string;
8
+ description: string;
9
+ slug: string;
10
+ snippet?: string;
11
+ }
12
+
13
  export interface Category {
14
  title: string;
15
  slug: string;
 
18
  status: CategoryStatus;
19
  colorName: string;
20
  graphic: React.ComponentType<React.SVGProps<SVGSVGElement>>;
21
+ demos?: Demo[];
22
  }