(feat): add tooltips
All checks were successful
/ deploy (push) Successful in 14m56s

(fix): small ui and layout bug
This commit is contained in:
Alois 2026-05-09 21:12:24 +02:00
commit dd09ca943d
10 changed files with 279 additions and 171 deletions

View file

@ -1,17 +1,21 @@
import { Button } from "@tensamin/ui";
import { Button, Tooltip, TooltipContent, TooltipTrigger } from "@tensamin/ui";
import { toggleDeaf, useCall } from "../../store";
import { HeadphoneOff, Headphones } from "lucide-react";
export default function DeafButton({
className,
iconSize,
tooltip,
portalContainer,
}: {
className?: string;
iconSize?: number;
tooltip?: string;
portalContainer?: HTMLElement;
}) {
const deaf = useCall((state) => state.deaf);
return (
const button = (
<Button
variant={deaf ? "destructive" : "default"}
onClick={toggleDeaf}
@ -28,4 +32,17 @@ export default function DeafButton({
)}
</Button>
);
if (!tooltip) {
return button;
}
return (
<Tooltip>
<TooltipTrigger render={button} />
<TooltipContent portalProps={{ container: portalContainer }}>
{tooltip}
</TooltipContent>
</Tooltip>
);
}