mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-03 06:42:27 +08:00
- Add Biome as formatter and linter (replaces Prettier) - Configure Husky + lint-staged for pre-commit hooks - Add VS Code settings for format on save - Ignore components/ui/ (shadcn generated code) - Remove semicolons, use 4-space indent - Reformat all files to new style
37 lines
995 B
TypeScript
37 lines
995 B
TypeScript
import type { VariantProps } from "class-variance-authority"
|
|
import type React from "react"
|
|
import { Button, type buttonVariants } from "@/components/ui/button"
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipProvider,
|
|
TooltipTrigger,
|
|
} from "@/components/ui/tooltip"
|
|
|
|
interface ButtonWithTooltipProps
|
|
extends React.ComponentProps<"button">,
|
|
VariantProps<typeof buttonVariants> {
|
|
tooltipContent: string
|
|
children: React.ReactNode
|
|
asChild?: boolean
|
|
}
|
|
|
|
export function ButtonWithTooltip({
|
|
tooltipContent,
|
|
children,
|
|
...buttonProps
|
|
}: ButtonWithTooltipProps) {
|
|
return (
|
|
<TooltipProvider>
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Button {...buttonProps}>{children}</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent className="max-w-xs text-wrap">
|
|
{tooltipContent}
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
</TooltipProvider>
|
|
)
|
|
}
|