(feat): add basic voice buttons
This commit is contained in:
parent
92c39d38b1
commit
246163486c
8 changed files with 99 additions and 47 deletions
44
packages/call/src/components/buttons/screenshare.tsx
Normal file
44
packages/call/src/components/buttons/screenshare.tsx
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { Button, Popover, PopoverContent, PopoverTrigger } from "@tensamin/ui";
|
||||
import { MonitorDot, ScreenShare } from "lucide-react";
|
||||
import { useCall } from "../../context";
|
||||
|
||||
export default function ScreenshareButton({
|
||||
className,
|
||||
}: {
|
||||
className?: string;
|
||||
}) {
|
||||
const { room } = useCall();
|
||||
|
||||
const isScreensharing = room.localParticipant.isScreenShareEnabled;
|
||||
|
||||
return (
|
||||
<Popover>
|
||||
<PopoverTrigger
|
||||
render={
|
||||
<Button
|
||||
variant={isScreensharing ? "secondary" : "default"}
|
||||
className={className}
|
||||
>
|
||||
{isScreensharing ? <MonitorDot /> : <ScreenShare />}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<PopoverContent className="w-auto flex flex-col gap-2">
|
||||
<Button
|
||||
disabled={isScreensharing}
|
||||
onClick={() => room.localParticipant.setScreenShareEnabled(true)}
|
||||
>
|
||||
Start
|
||||
</Button>
|
||||
<Button
|
||||
variant="destructive"
|
||||
disabled={!isScreensharing}
|
||||
onClick={() => room.localParticipant.setScreenShareEnabled(false)}
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
<Button>idk</Button>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue