-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathlist-features.tsx
107 lines (100 loc) · 3.02 KB
/
list-features.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'use client'
import { Feature } from '@/types/feature'
import { cn } from '@/lib/utils'
import { useBuilder } from '@/store'
const LIST_FEATURES: Feature[] = [
{
id: 'ai',
title: 'AI',
description: 'Reduce complexity and enhance productivity effortlessly with AI.',
textColorTitle: 'from-yellow-100 to-yellow-700',
background: 'from-[#f7e397] to-[#c2bb3d] hover:to-[#f0e84e]',
textColorCard: 'text-yellow-800'
},
{
id: 'ease',
title: 'Copy-Paste',
description: 'Copy and paste with ease. Save time and effort while creating stunning READMEs.',
textColorTitle: 'from-pink-200 to-pink-700',
background: 'from-[#f2c8ec] to-[#e180f4] hover:to-[#e061f9]',
textColorCard: 'text-pink-800'
},
{
id: 'templates',
title: 'Templates',
description:
'Choose from a variety of elegant templates. Enhance readability for your READMEs.',
textColorTitle: 'from-sky-200 to-blue-600',
background: 'from-sky-200 to-[#58a6c7] hover:to-[#39819f]',
textColorCard: 'text-sky-800'
},
{
id: 'customization',
title: 'Customization',
description: 'Add or remove sections seamlessly to tailor templates to your project needs.',
textColorTitle: 'from-indigo-300 via-orange-200 to-red-800',
background: 'from-[#27224d] to-[#151229] hover:to-[#0a071e]',
textColorCard: 'text-purple-100'
},
{
id: 'offline',
title: 'Local',
description: 'Enjoy offline capabilities and manage your READMEs without an API key.',
textColorTitle: 'from-orange-200 to-amber-700',
background: 'from-[#ffeda0] to-[#cb6c4a] hover:to-[#ea5a26]',
textColorCard: 'text-orange-700'
}
]
type FeatureItemProps = {
id: string
title: string
description: string
textColorTitle: string
background: string
textColorCard: string
}
function FeatureItem({
title,
description,
textColorTitle,
background,
textColorCard
}: FeatureItemProps) {
const setFeatureSelected = useBuilder((store) => store.setFeatureSelected)
const featureSelected = useBuilder((store) => store.featureSelected)
return (
<div
className={cn(
'group z-10 w-full h-auto flex items-center bg-gradient-to-tr rounded-md p-2 border bg-transparent cursor-pointer',
featureSelected?.title === title && background
)}
onClick={() =>
setFeatureSelected({
title,
description,
textColorTitle
})
}
>
<div className='flex flex-col gap-1'>
<h3
className={cn(
'text-xs md:text-sm text-balance font-semibold text-[#737373] group-hover:pointer-events-none transition-all duration-300 ease-in-out',
featureSelected?.title === title ? `${textColorCard}` : 'group-hover:text-white'
)}
>
{title}
</h3>
</div>
</div>
)
}
export function ListFeatures() {
return (
<div className='w-full h-auto hidden sm:flex gap-3'>
{LIST_FEATURES.map((feature) => (
<FeatureItem key={feature.id} {...feature} />
))}
</div>
)
}