20 lines
496 B
TypeScript
20 lines
496 B
TypeScript
import { apiFetch } from "@/api/auth";
|
|
import { useEffect, useState } from "react";
|
|
|
|
export function Video() {
|
|
const [video, setVideo] = useState<string | null>(null);
|
|
const getVideo = async () => {
|
|
const res = await apiFetch("/protected/video");
|
|
const txt = await res.text()
|
|
setVideo(txt)
|
|
}
|
|
useEffect(() => {
|
|
getVideo()
|
|
}, [])
|
|
return (
|
|
<div className="flex flex-1 flex-col gap-4 py-16">
|
|
{video}
|
|
</div>
|
|
);
|
|
}
|