import { useEffect, useRef, useState } from 'react'
import '../css/Media.css'
const MediaComponent = ({src, width}) => {
return (
)
}
const Media = () => {
const [index, updateIndex] = useState([])
const mediaPage = useRef(null);
useEffect(() => {
(async () => {
const response = await fetch(`/clips`);
if (response.status !== 200) return console.error('Failed to get clip index');
updateIndex([...index, ...await response.json()])
})()
}, []);
return (
{index.map(elem => )}
)
}
export default Media;