xonecas.io
4828
Sr

stream-together / files

stream-together / components / video-toggle-button.tsx

835 bytes
1import { IoVideocamOutline as VideoOnIcon } from "react-icons/io5";
2import { IoVideocamOffOutline as VideoOffIcon } from "react-icons/io5";
3
4import SecondaryButton from "./secondary-button";
5
6export default function VideoToggleButton({
7  videoStarted,
8  handleToggleVideo,
9}: Readonly<{
10  videoStarted: boolean;
11  handleToggleVideo: () => void;
12}>) {
13  return (
14    <button
15      onClick={handleToggleVideo}
16      title={videoStarted ? "Turn video off" : "Turn video on"}
17    >
18      <SecondaryButton>
19        <div className="flex flex-row items-center gap-2 p-2">
20          {videoStarted ? (
21            <VideoOnIcon size="1.5em" />
22          ) : (
23            <VideoOffIcon size="1.5em" />
24          )}
25          <p>{videoStarted ? "Turn video off" : "Turn video on"}</p>
26        </div>
27      </SecondaryButton>
28    </button>
29  );
30}