/** * ╔══════════════════════════════════════════════════════════════════╗ * ║ ║ * ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║ * ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║ * ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║ * ║ ║ * ║ © 2026 CodeX Devs — All Rights Reserved ║ * ║ ║ * ║ discord ── https://discord.gg/codexdev ║ * ║ youtube ── https://youtube.com/@CodeXDevs ║ * ║ github ── https://github.com/RayExo ║ * ║ ║ * ╚══════════════════════════════════════════════════════════════════╝ */ "use client"; import * as React from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; import { ShieldCheck, Ticket, BarChart4, FileText, Settings, Layers, Sword, Activity, SmilePlus, Rocket, Shield, MessageSquare, Sparkles, Link as LinkIcon, Bot, ChevronLeft, ChevronRight, Volume2, Link2, Zap, Mic, Mail } from "lucide-react"; interface Tab { name: string; href: string; icon: any; } export function GuildTabs({ guildId }: { guildId: string }) { const pathname = usePathname(); const scrollContainerRef = React.useRef(null); const scroll = (direction: "left" | "right") => { if (scrollContainerRef.current) { const scrollAmount = 200; scrollContainerRef.current.scrollBy({ left: direction === "left" ? -scrollAmount : scrollAmount, behavior: "smooth", }); } }; const tabs: Tab[] = [ { name: "Overview", href: `/dashboard/guild/${guildId}`, icon: Layers }, { name: "Anti-Nuke", href: `/dashboard/guild/${guildId}/antinuke`, icon: Sword }, { name: "Automod", href: `/dashboard/guild/${guildId}/automod`, icon: ShieldCheck }, { name: "Tickets", href: `/dashboard/guild/${guildId}/tickets`, icon: Ticket }, { name: "Verification", href: `/dashboard/guild/${guildId}/verification`, icon: Shield }, { name: "Welcome", href: `/dashboard/guild/${guildId}/welcome`, icon: SmilePlus }, { name: "Invites", href: `/dashboard/guild/${guildId}/invites`, icon: LinkIcon }, { name: "Auto Role", href: `/dashboard/guild/${guildId}/autorole`, icon: Bot }, { name: "Reaction Roles", href: `/dashboard/guild/${guildId}/reactionroles`, icon: Activity }, { name: "Join to Create", href: `/dashboard/guild/${guildId}/j2c`, icon: Mic }, { name: "Voice Role", href: `/dashboard/guild/${guildId}/invcrole`, icon: Volume2 }, { name: "Vanity Roles", href: `/dashboard/guild/${guildId}/vanityroles`, icon: Link2 }, { name: "Auto React", href: `/dashboard/guild/${guildId}/autoreact`, icon: Zap }, { name: "Custom Roles", href: `/dashboard/guild/${guildId}/customroles`, icon: Sparkles }, { name: "Join DM", href: `/dashboard/guild/${guildId}/joindm`, icon: Mail }, { name: "Leveling", href: `/dashboard/guild/${guildId}/leveling`, icon: BarChart4 }, { name: "Logging", href: `/dashboard/guild/${guildId}/logging`, icon: FileText }, { name: "Settings", href: `/dashboard/guild/${guildId}/settings`, icon: Settings }, ].filter(tab => tab.href); // Filter out any undefined hrefs return (
{/* Scroll Arrows */} {/* Left Fade */}
{tabs.map((tab) => { const isActive = pathname === tab.href; return (
{tab.name}
); })}
{/* Right Fade */}
); }