56 lines
2.2 KiB
TypeScript
56 lines
2.2 KiB
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
import {
|
|
Layers,
|
|
MessageSquare,
|
|
Mail,
|
|
BarChart3,
|
|
Share2,
|
|
PhoneCall,
|
|
Truck,
|
|
} from 'lucide-react';
|
|
|
|
interface IntegrationsHeaderNavProps {
|
|
activeTab?: string;
|
|
badgeCounts?: Record<string, string>;
|
|
}
|
|
|
|
export const IntegrationsHeaderNav: React.FC<IntegrationsHeaderNavProps> = ({ activeTab }) => {
|
|
const pathname = usePathname();
|
|
|
|
const tabs = [
|
|
{ id: 'overview', name: 'All', href: '/integrations', icon: Layers, match: pathname === '/integrations' },
|
|
{ id: 'whatsapp', name: 'WhatsApp', href: '/integrations/whatsapp', icon: MessageSquare, match: pathname.startsWith('/integrations/whatsapp') },
|
|
{ id: 'email', name: 'Email', href: '/integrations/email', icon: Mail, match: pathname.startsWith('/integrations/email') },
|
|
{ id: 'google-analytics', name: 'Analytics', href: '/integrations/google-analytics', icon: BarChart3, match: pathname.startsWith('/integrations/google-analytics') || pathname.startsWith('/analytics/google') },
|
|
{ id: 'meta-ads', name: 'Meta', href: '/integrations/meta-ads', icon: Share2, match: pathname.startsWith('/integrations/meta-ads') },
|
|
{ id: 'call', name: 'Knowlarity', href: '/integrations/call', icon: PhoneCall, match: pathname.startsWith('/integrations/call') },
|
|
{ id: 'shipping', name: 'Shiprocket', href: '/integrations/shipping', icon: Truck, match: pathname.startsWith('/integrations/shipping') },
|
|
];
|
|
|
|
return (
|
|
<div className="flex items-center gap-2 overflow-x-auto pb-1">
|
|
{tabs.map((tab) => {
|
|
const Icon = tab.icon;
|
|
const isActive = tab.match || activeTab === tab.id;
|
|
return (
|
|
<Link
|
|
key={tab.id}
|
|
href={tab.href}
|
|
className={`inline-flex items-center gap-1.5 h-9 px-3 crm-radius-control text-[13px] font-semibold whitespace-nowrap ${
|
|
isActive
|
|
? 'bg-primary text-white'
|
|
: 'border border-border bg-card text-foreground hover:bg-muted'
|
|
}`}
|
|
>
|
|
<Icon className="w-3.5 h-3.5" />
|
|
{tab.name}
|
|
</Link>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
};
|