mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
* feat: decouple package deps and introduce yarn workspaces * update root directory * fix * fix scripts * fix lint * update path in scripts * remove yarn.lock files from packages * ignore workspace * dummy * dummy * remove comment check * revert workflow changes * ignore ws when installing gh actions * remove log * update path * fix * fix typo
26 lines
689 B
TypeScript
26 lines
689 B
TypeScript
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
import { SidebarTabName } from "../../types";
|
|
|
|
export const SidebarTabTrigger = ({
|
|
children,
|
|
tab,
|
|
onSelect,
|
|
...rest
|
|
}: {
|
|
children: React.ReactNode;
|
|
tab: SidebarTabName;
|
|
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
} & Omit<React.HTMLAttributes<HTMLButtonElement>, "onSelect">) => {
|
|
return (
|
|
<RadixTabs.Trigger value={tab} asChild onSelect={onSelect}>
|
|
<button
|
|
type={"button"}
|
|
className={`excalidraw-button sidebar-tab-trigger`}
|
|
{...rest}
|
|
>
|
|
{children}
|
|
</button>
|
|
</RadixTabs.Trigger>
|
|
);
|
|
};
|
|
SidebarTabTrigger.displayName = "SidebarTabTrigger";
|