(feat): move call context to zustand

(feat): add actions, basic call page
This commit is contained in:
Alois 2026-04-29 14:49:53 +02:00
commit 413764f33e
17 changed files with 673 additions and 382 deletions

View file

@ -1,17 +1,27 @@
import { Button } from "@tensamin/ui";
import { useCall } from "../../context";
import { toggleMute, useCall } from "../../store";
import { Mic, MicOff } from "lucide-react";
export default function MuteButton({ className }: { className?: string }) {
const { room } = useCall();
const micEnabled = room.localParticipant.isMicrophoneEnabled;
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 /> : <MicOff />}
{micEnabled ? (
<Mic style={{ scale: (iconSize ? iconSize + 100 : 100) + "%" }} />
) : (
<MicOff style={{ scale: (iconSize ? iconSize + 100 : 100) + "%" }} />
)}
</Button>
);
}