import React from "react"; import { VideoOff } from "lucide-react"; import { useCameraStream } from "@/hooks/useCameraStream"; interface CameraFeedProps { /** Browser deviceId to stream. Empty string renders the "no camera" state. */ deviceId: string; /** Optional caption shown under the feed. */ label?: string; } /** Live browser-camera feed bound to a deviceId via getUserMedia. */ const CameraFeed: React.FC = ({ deviceId, label }) => { const { videoRef, hasError } = useCameraStream(deviceId, false); const showVideo = deviceId && !hasError; return (
{showVideo ? (
{label && (
{label}
)}
); }; export default CameraFeed;