client/packages/call/src/components/buttons/mute.tsx
Alois be56080ba1
Some checks failed
/ build-desktop (linux) (push) Failing after 52s
/ build-web (push) Failing after 1m3s
/ build-mobile (push) Failing after 1m6s
/ release (push) Has been skipped
(fix): remove unused dependencies
(fix): remove dead code
(fix): remove unused exports
2026-06-03 14:53:18 +02:00

29 lines
761 B
TypeScript

import { Button } from "@tensamin/ui";
import { toggleMute, useCall } from "../../store";
import { Mic, MicOff } from "lucide-react";
import { type CallButtonProps, iconScale, withTooltip } from "./tooltipButton";
export default function MuteButton({
className,
iconSize,
tooltip,
portalContainer,
}: CallButtonProps) {
const micEnabled = useCall((state) => state.micEnabled);
const button = (
<Button
variant={micEnabled ? "default" : "destructive"}
className={className}
onClick={() => void toggleMute()}
>
{micEnabled ? (
<Mic style={iconScale(iconSize)} />
) : (
<MicOff style={iconScale(iconSize)} />
)}
</Button>
);
return withTooltip(button, tooltip, portalContainer);
}