mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
9302c06311
* update biome config + resolve issues * improve the ui:sync command to run organizeImports on packages * reformat * build registry * exclude base-ui stuff * fix useExportsLast * further improvements * silence errors * exclude examples app * update biome + reformat * format all the other files * include examples app * improve copyable-field * remove unwanted comment * remove a few unneeded biome comments * avoid nested ternary * refactored some shared components * upgrade base ui to 1.2.0 * fix
26 lines
629 B
TypeScript
26 lines
629 B
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { Tabs } from "@/registry/default/ui/tabs";
|
|
import { useConfig } from "@/hooks/use-config";
|
|
|
|
export function CodeTabs({ children }: React.ComponentProps<typeof Tabs>) {
|
|
const [config, setConfig] = useConfig();
|
|
|
|
const installationType = React.useMemo(() => {
|
|
return config.installationType || "cli";
|
|
}, [config]);
|
|
|
|
return (
|
|
<Tabs
|
|
className="relative mt-6 w-full"
|
|
onValueChange={(value) =>
|
|
setConfig({ ...config, installationType: value as "cli" | "manual" })
|
|
}
|
|
value={installationType}
|
|
>
|
|
{children}
|
|
</Tabs>
|
|
);
|
|
}
|