import { apiFetch } from "@/api/auth"; import { useEffect, useState } from "react"; export function Video() { const [video, setVideo] = useState(null); const getVideo = async () => { const res = await apiFetch("/protected/video"); const txt = await res.text() setVideo(txt) } useEffect(() => { getVideo() }, []) return (
{video}
); }