2024-11-20 11:14:21 +08:00
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Card, CardContent } from '@/components/ui/card';
|
2025-01-17 19:01:09 +08:00
|
|
|
import { Segmented, SegmentedValue } from '@/components/ui/segmented';
|
2024-11-20 11:14:21 +08:00
|
|
|
import { ChevronRight, Cpu, MessageSquare, Search } from 'lucide-react';
|
2024-11-22 15:11:38 +08:00
|
|
|
import { useMemo, useState } from 'react';
|
2024-11-20 11:14:21 +08:00
|
|
|
|
|
|
|
|
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() {
|
2024-11-22 15:11:38 +08:00
|
|
|
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);
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-20 11:14:21 +08:00
|
|
|
return (
|
|
|
|
|
<section className="mt-12">
|
|
|
|
|
<div className="flex justify-between items-center mb-6">
|
2024-12-03 18:59:11 +08:00
|
|
|
<h2 className="text-2xl font-bold ">Applications</h2>
|
2024-11-22 15:11:38 +08:00
|
|
|
<Segmented
|
|
|
|
|
options={options}
|
|
|
|
|
value={val}
|
|
|
|
|
onChange={handleChange}
|
2024-12-03 18:59:11 +08:00
|
|
|
className="bg-colors-background-inverse-standard text-colors-text-neutral-standard"
|
2024-11-22 15:11:38 +08:00
|
|
|
></Segmented>
|
2024-11-20 11:14:21 +08:00
|
|
|
</div>
|
|
|
|
|
<div className="grid grid-cols-4 gap-6">
|
|
|
|
|
{[...Array(12)].map((_, i) => {
|
|
|
|
|
const app = applications[i % 4];
|
|
|
|
|
return (
|
2024-12-03 18:59:11 +08:00
|
|
|
<Card
|
|
|
|
|
key={i}
|
|
|
|
|
className="bg-colors-background-inverse-weak border-colors-outline-neutral-standard"
|
|
|
|
|
>
|
2024-11-20 11:14:21 +08:00
|
|
|
<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>
|
2024-12-03 18:59:11 +08:00
|
|
|
<Button variant="icon" size="icon">
|
2024-11-20 11:14:21 +08:00
|
|
|
<ChevronRight className="h-6 w-6" />
|
|
|
|
|
</Button>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|