mirror of
https://github.com/vercel/ai-elements.git
synced 2026-09-14 19:48:26 +08:00
30cbcfec97
* Migrate to oxlint / oxfmt * Initial fixes * Misc fixes * Temporary fixes * Update Ultracite * Update .oxlintrc.json * Update .oxlintrc.json * Start running manual fixes * Update .oxlintrc.json * AI Fixes Part 2 * AI Fixes Part 3 * AI Fixes Part 4 * AI Fixes Part 5 * AI Fixes Part 6 * AI Fixes Part 7 * AI Fixes Part 8 * AI Fixes Part 9 * AI Fixes Part 10 * AI Fixes Part 11 * AI Fixes Part 12 * Fix tests * Lint / test fixes * Update chat.tsx * Fix AI SDK React version * Misc fixes * Build fixes
63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
import type { ComponentProps } from "react";
|
|
|
|
import { cn } from "@repo/shadcn-ui/lib/utils";
|
|
import {
|
|
Tabs,
|
|
TabsContent,
|
|
TabsList,
|
|
TabsTrigger,
|
|
} from "fumadocs-ui/components/tabs.unstyled";
|
|
|
|
export const CodeBlockTabsList = (props: ComponentProps<typeof TabsList>) => (
|
|
<TabsList
|
|
{...props}
|
|
className={cn(
|
|
"w-full rounded-none border-b bg-sidebar px-2.5 text-muted-foreground",
|
|
props.className
|
|
)}
|
|
>
|
|
{props.children}
|
|
</TabsList>
|
|
);
|
|
|
|
export const CodeBlockTabsTrigger = ({
|
|
children,
|
|
...props
|
|
}: ComponentProps<typeof TabsTrigger>) => (
|
|
<TabsTrigger
|
|
{...props}
|
|
className={cn(
|
|
"group relative px-1 py-2 text-sm data-[state=active]:text-primary",
|
|
props.className
|
|
)}
|
|
>
|
|
<div className="absolute inset-x-0 bottom-0 h-px group-data-[state=active]:bg-primary" />
|
|
{children}
|
|
</TabsTrigger>
|
|
);
|
|
|
|
export const CodeBlockTabs = ({
|
|
ref,
|
|
...props
|
|
}: ComponentProps<typeof Tabs>) => (
|
|
<Tabs
|
|
{...props}
|
|
className={cn(
|
|
"overflow-hidden rounded-sm border bg-background",
|
|
props.className
|
|
)}
|
|
>
|
|
{props.children}
|
|
</Tabs>
|
|
);
|
|
|
|
export const CodeBlockTab = (props: ComponentProps<typeof TabsContent>) => (
|
|
<TabsContent
|
|
{...props}
|
|
className={cn(
|
|
"[&>div]:mb-0 [&_pre]:rounded-none [&_pre]:border-none",
|
|
props.className
|
|
)}
|
|
/>
|
|
);
|