forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppGridSection.tsx
More file actions
51 lines (46 loc) · 1.29 KB
/
Copy pathAppGridSection.tsx
File metadata and controls
51 lines (46 loc) · 1.29 KB
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
'use client';
import Link from '@tschk/moonshine-next/link';
import { ChevronRight } from 'lucide-react';
import { cn } from '@/lib/utils';
import type { App } from '@/types/apps';
import { AppCard } from './AppCard';
interface AppGridSectionProps {
title: string;
apps: App[];
totalCount?: number;
capabilityId?: string;
onUpdate?: () => void;
}
export function AppGridSection({
title,
apps,
totalCount,
capabilityId,
onUpdate,
}: AppGridSectionProps) {
const showViewAll = totalCount && totalCount > apps.length;
return (
<section>
<div className="flex items-center justify-between mb-4">
<h2 className="text-lg font-semibold text-text-primary">{title}</h2>
{showViewAll && capabilityId && (
<Link
href={`/connectors?capability=${capabilityId}`}
className={cn(
'flex items-center gap-1 text-sm text-text-primary',
'hover:underline',
)}
>
View all ({totalCount})
<ChevronRight className="w-4 h-4" />
</Link>
)}
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
{apps.map((app) => (
<AppCard key={app.id} app={app} onUpdate={onUpdate} />
))}
</div>
</section>
);
}