forked from cerc-io/snowballtools-base
commit ea08482596e10f27536af2d32040b476a18085e0 Author: icld <ian@icld.io> Date: Tue Feb 25 07:06:03 2025 -0800 refactor: update WalletContext import and enhance layout components
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
/**
|
|
* TabWrapperProps interface extends React.ComponentProps<typeof Tabs> to include all standard Tabs attributes.
|
|
*/
|
|
interface TabWrapperProps extends React.ComponentProps<typeof Tabs> {
|
|
/**
|
|
* The orientation of the tabs.
|
|
* @default 'horizontal'
|
|
*/
|
|
orientation?: 'horizontal' | 'vertical';
|
|
}
|
|
|
|
/**
|
|
* A wrapper component for the Tabs component from `ui/tabs`.
|
|
*
|
|
* @param {TabWrapperProps} props - The props for the component.
|
|
* @returns {React.ReactElement} A Tabs element containing the tabs and content.
|
|
*/
|
|
export function TabWrapper({
|
|
children,
|
|
className,
|
|
orientation = 'horizontal',
|
|
...props
|
|
}: TabWrapperProps) {
|
|
return (
|
|
<Tabs
|
|
{...props}
|
|
orientation={orientation}
|
|
className={cn(
|
|
'w-full lg:max-w-2xl mx-auto',
|
|
orientation === 'vertical' && 'flex gap-6',
|
|
className,
|
|
)}
|
|
>
|
|
{children}
|
|
</Tabs>
|
|
);
|
|
}
|
|
|
|
// Re-export tab components for convenience
|
|
export { TabsContent, TabsList, TabsTrigger };
|