client/packages/call/src/components/buttons/mute.tsx
Alois 6a5236bafe
All checks were successful
/ build-web (push) Successful in 7m40s
/ build-desktop (linux) (push) Successful in 12m6s
/ build-mobile (push) Successful in 19m4s
/ release (push) Successful in 3m25s
(feat): add reply box to messages
(feat): update methanium ui
(fix): user data caching
(fix): other random stuff
(qol): update todo
2026-07-30 23:01:42 +02:00

33 lines
781 B
TypeScript

import { Button } from "@methanium/ui";
import { toggleMute, useCall } from "../../store";
import { Mic, MicOff } from "lucide-react";
import {
type CallButtonProps,
iconScale,
withButtonTooltip,
} 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 withButtonTooltip(button, tooltip, portalContainer);
}