import { useState } from "react"; import { Drawer, DrawerContent, DrawerTrigger } from "../ui/drawer"; import { Button } from "../ui/button"; import { FaVideo } from "react-icons/fa"; import { isMobile } from "react-device-detect"; type MobileCameraDrawerProps = { allCameras: string[]; selected: string; onSelectCamera: (cam: string) => void; }; export default function MobileCameraDrawer({ allCameras, selected, onSelectCamera, }: MobileCameraDrawerProps) { const [cameraDrawer, setCameraDrawer] = useState(false); if (!isMobile) { return; } return (
{allCameras.map((cam) => (
{ onSelectCamera(cam); setCameraDrawer(false); }} > {cam.replaceAll("_", " ")}
))}
); }