File size: 2,844 Bytes
3fa1285 2d64850 3fa1285 2d64850 3fa1285 2d64850 3fa1285 8446e15 2d64850 8446e15 2d64850 3fa1285 8446e15 3fa1285 8446e15 3fa1285 |
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 |
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { Segmented, SegmentedValue } from '@/components/ui/segmented ';
import { ChevronRight, Cpu, MessageSquare, Search } from 'lucide-react';
import { useMemo, useState } from 'react';
const applications = [
{
id: 1,
title: 'Jarvis chatbot',
type: 'Chat app',
date: '11/24/2024',
icon: <MessageSquare className="h-6 w-6" />,
},
{
id: 2,
title: 'Search app 01',
type: 'Search app',
date: '11/24/2024',
icon: <Search className="h-6 w-6" />,
},
{
id: 3,
title: 'Chatbot 01',
type: 'Chat app',
date: '11/24/2024',
icon: <MessageSquare className="h-6 w-6" />,
},
{
id: 4,
title: 'Workflow 01',
type: 'Agent',
date: '11/24/2024',
icon: <Cpu className="h-6 w-6" />,
},
];
export function Applications() {
const [val, setVal] = useState('all');
const options = useMemo(() => {
return [
{
label: 'All',
value: 'all',
},
{
label: 'Chat',
value: 'chat',
},
{
label: 'Search',
value: 'search',
},
{
label: 'Agent',
value: 'agent',
},
];
}, []);
const handleChange = (path: SegmentedValue) => {
setVal(path as string);
};
return (
<section className="mt-12">
<div className="flex justify-between items-center mb-6">
<h2 className="text-2xl font-bold ">Applications</h2>
<Segmented
options={options}
value={val}
onChange={handleChange}
className="bg-colors-background-inverse-standard text-colors-text-neutral-standard"
></Segmented>
</div>
<div className="grid grid-cols-4 gap-6">
{[...Array(12)].map((_, i) => {
const app = applications[i % 4];
return (
<Card
key={i}
className="bg-colors-background-inverse-weak border-colors-outline-neutral-standard"
>
<CardContent className="p-4 flex items-center gap-6">
<div className="w-[70px] h-[70px] rounded-xl flex items-center justify-center bg-gradient-to-br from-[#45A7FA] via-[#AE63E3] to-[#4433FF]">
{app.icon}
</div>
<div className="flex-1">
<h3 className="text-lg font-semibold">{app.title}</h3>
<p className="text-sm opacity-80">{app.type}</p>
<p className="text-sm opacity-80">{app.date}</p>
</div>
<Button variant="icon" size="icon">
<ChevronRight className="h-6 w-6" />
</Button>
</CardContent>
</Card>
);
})}
</div>
</section>
);
}
|