client/packages/call/src/components/buttons/mute.tsx
Alois 413764f33e (feat): move call context to zustand
(feat): add actions, basic call page
2026-04-29 14:49:53 +02:00

27 lines
679 B
TypeScript

import { Button } from "@tensamin/ui";
import { toggleMute, useCall } from "../../store";
import { Mic, MicOff } from "lucide-react";
export default function MuteButton({
className,
iconSize,
}: {
className?: string;
iconSize?: number;
}) {
const micEnabled = useCall((state) => state.micEnabled);
return (
<Button
variant={micEnabled ? "default" : "destructive"}
className={className}
onClick={() => void toggleMute()}
>
{micEnabled ? (
<Mic style={{ scale: (iconSize ? iconSize + 100 : 100) + "%" }} />
) : (
<MicOff style={{ scale: (iconSize ? iconSize + 100 : 100) + "%" }} />
)}
</Button>
);
}