|
1 | 1 | 'use client'; |
2 | | -import { useState } from 'react'; |
3 | | -import { motion } from 'framer-motion'; |
4 | 2 | import Link from 'next/link'; |
5 | 3 | import * as AspectRatio from '@radix-ui/react-aspect-ratio'; |
6 | 4 | import Image from 'next/image'; |
7 | | -import preview from '@/assets/preview'; |
8 | | -const appsDesign = [ |
9 | | - { |
10 | | - id: 'motionNumber', |
11 | | - name: 'motion number', |
12 | | - url: '/components/motion-number', |
13 | | - imgSrc: preview.motionNumber, |
14 | | - }, |
15 | | - { |
16 | | - id: 'buttons', |
17 | | - url: '/components/buttons', |
18 | | - name: 'buttons', |
19 | | - imgSrc: preview.buttons, |
20 | | - }, |
21 | | - { |
22 | | - id: 'horizontal-scrolling', |
23 | | - url: '/components/horizontal-scroll', |
24 | | - name: 'scrolling', |
25 | | - imgSrc: preview.horizontascroll, |
26 | | - }, |
27 | | - { |
28 | | - id: 'clip-path', |
29 | | - url: '/components/clip-path', |
30 | | - name: 'Clip-Path', |
31 | | - imgSrc: preview.clippath, |
32 | | - }, |
33 | | - { |
34 | | - id: 'image-reveal', |
35 | | - url: '/components/product-cards', |
36 | | - name: 'Cards', |
37 | | - imgSrc: preview.card, |
38 | | - }, |
39 | | -]; |
| 5 | +import componentsOverviewCards from '@/configs/componentsOverview'; |
40 | 6 |
|
41 | 7 | export default function Home() { |
42 | 8 | return ( |
43 | 9 | <> |
44 | 10 | <div className='pt-20 pb-5'> |
45 | | - <h1 |
46 | | - className={'sm:text-3xl text-2xl font-semibold tracking-tight pb-1'} |
47 | | - > |
| 11 | + <h1 className={'sm:text-3xl text-2xl font-semibold tracking-tight pb-1'}> |
48 | 12 | Components |
49 | 13 | </h1> |
50 | 14 |
|
51 | 15 | <p className='md:text-lg text-sm text-muted-foreground lg:w-[80%]'> |
52 | 16 | Beautifully designed components that you can copy and paste into your |
53 | 17 | apps. Accessible. Customizable. Open Source. |
54 | 18 | </p> |
55 | | - <> |
56 | | - <div className='grid md:grid-cols-3 grid-cols-2 gap-6 py-4'> |
57 | | - {appsDesign.map((component, index) => { |
58 | | - return ( |
59 | | - <> |
60 | | - <Link |
61 | | - href={component?.url} |
62 | | - className='border p-2 transition-all rounded-lg' |
63 | | - > |
64 | | - <> |
65 | | - <AspectRatio.Root ratio={16 / 9}> |
66 | | - <Image |
67 | | - src={component.imgSrc} |
68 | | - alt='hero-sec' |
69 | | - width={100} |
70 | | - height={100} |
71 | | - className='w-full h-full rounded-md' |
72 | | - /> |
73 | | - </AspectRatio.Root> |
74 | | - </> |
75 | | - <div className='sm:py-2 py-1 sm:px-4 px-2'> |
76 | | - <h1 className='2xl:text-xl xl:text-xl md:text-lg text-sm font-medium leading-[140%] capitalize'> |
77 | | - {component.name} |
78 | | - </h1> |
79 | | - </div> |
80 | | - </Link> |
81 | | - </> |
82 | | - ); |
83 | | - })} |
84 | | - </div> |
85 | | - </> |
| 19 | + |
| 20 | + <div className='grid md:grid-cols-3 grid-cols-2 gap-6 py-4'> |
| 21 | + {componentsOverviewCards?.map((component, index) => { |
| 22 | + return ( |
| 23 | + <> |
| 24 | + <Link |
| 25 | + href={component?.url} |
| 26 | + className='border p-2 transition-all rounded-lg' |
| 27 | + > |
| 28 | + <> |
| 29 | + <AspectRatio.Root ratio={16 / 9}> |
| 30 | + <Image |
| 31 | + src={component.imgSrc} |
| 32 | + alt='hero-sec' |
| 33 | + width={100} |
| 34 | + height={100} |
| 35 | + className='w-full h-full rounded-md' |
| 36 | + /> |
| 37 | + </AspectRatio.Root> |
| 38 | + </> |
| 39 | + <div className='sm:py-2 py-1 sm:px-4 px-2'> |
| 40 | + <h1 className='2xl:text-xl xl:text-xl md:text-lg text-sm font-medium leading-[140%] capitalize'> |
| 41 | + {component.name} |
| 42 | + </h1> |
| 43 | + </div> |
| 44 | + </Link> |
| 45 | + </> |
| 46 | + ); |
| 47 | + })} |
| 48 | + </div> |
86 | 49 | </div> |
87 | 50 | </> |
88 | 51 | ); |
|
0 commit comments