mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: tooltips
This commit is contained in:
1 parent
c73eb0d951
commit
14fccf3f6e
4 files changed
+21
-2
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Button, Text } from '@radix-ui/themes';
|
||||
import { Button, Text, Tooltip } from '@radix-ui/themes';
|
||||
import { ComponentProps, ReactNode } from 'react';
|
||||
|
||||
export interface TankComponentButtonProps
|
||||
@@ -9,6 +9,7 @@ export interface TankComponentButtonProps
|
||||
disabled?: boolean;
|
||||
banner?: string;
|
||||
special?: boolean;
|
||||
tooltip?: string;
|
||||
}
|
||||
|
||||
export function TankComponentButton({
|
||||
@@ -20,9 +21,10 @@ export function TankComponentButton({
|
||||
banner,
|
||||
disabled,
|
||||
style,
|
||||
tooltip,
|
||||
...props
|
||||
}: TankComponentButtonProps) {
|
||||
return (
|
||||
const button = (
|
||||
<Button
|
||||
radius="medium"
|
||||
color={selected ? (special ? 'amber' : undefined) : 'gray'}
|
||||
@@ -73,4 +75,7 @@ export function TankComponentButton({
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
|
||||
if (tooltip) return <Tooltip content={tooltip}>{button}</Tooltip>;
|
||||
return button;
|
||||
}
|
||||
Reference in new issue
Block a user