Files
prowler/ui/components/shadcn/tabs/tabs.tsx

67 lines
1.2 KiB
TypeScript

"use client";
import * as TabsPrimitive from "@radix-ui/react-tabs";
import type { ComponentProps } from "react";
import { cn } from "@/lib/utils";
import {
buildListClassName,
buildTriggerClassName,
CONTENT_STYLES,
} from "./tabs.constants";
function Tabs({
className,
...props
}: ComponentProps<typeof TabsPrimitive.Root>) {
return (
<TabsPrimitive.Root
data-slot="tabs"
className={cn("w-full", className)}
{...props}
/>
);
}
function TabsList({
className,
...props
}: ComponentProps<typeof TabsPrimitive.List>) {
return (
<TabsPrimitive.List
data-slot="tabs-list"
className={cn(buildListClassName(), className)}
{...props}
/>
);
}
function TabsTrigger({
className,
...props
}: ComponentProps<typeof TabsPrimitive.Trigger>) {
return (
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(buildTriggerClassName(), className)}
{...props}
/>
);
}
function TabsContent({
className,
...props
}: ComponentProps<typeof TabsPrimitive.Content>) {
return (
<TabsPrimitive.Content
data-slot="tabs-content"
className={cn(CONTENT_STYLES, className)}
{...props}
/>
);
}
export { Tabs, TabsContent, TabsList, TabsTrigger };