import React from 'react';
import { cn } from '@/lib/utils';
interface TabsProps {
value: string;
onValueChange: (value: string) => void;
children: React.ReactNode;
className?: string;
}
interface TabsListProps {
children: React.ReactNode;
className?: string;
}
interface TabsTriggerProps {
value: string;
children: React.ReactNode;
className?: string;
disabled?: boolean;
icon?: React.ReactNode;
badge?: React.ReactNode;
}
interface TabsContentProps {
value: string;
children: React.ReactNode;
className?: string;
}
const TabsContext = React.createContext<{
value: string;
onValueChange: (value: string) => void;
} | null>(null);
function useTabsContext() {
const context = React.useContext(TabsContext);
if (!context) {
throw new Error('Tabs components must be used within a Tabs provider');
}
return context;
}
export function Tabs({ value, onValueChange, children, className }: TabsProps) {
return (