import { useEffect, useMemo, useRef } from "react"
import Draggable from "./utils/draggableDnd"
import { GithubOutlined, GitlabOutlined, LinkOutlined,
AudioOutlined, FileTextOutlined} from "@ant-design/icons"
import DraggableWrapper from "./draggable/draggable"
export function SidebarWidgetCard({ name, img, url, license, widgetClass, innerRef}){
const urlIcon = useMemo(() => {
if (url){
const host = new URL(url).hostname.toLowerCase()
if (host === "github.com"){
return
}else if(host === "gitlab.com"){
return
}else{
return
}
}
}, [url])
return (
//
//
)
}
export function DraggableAssetCard({file}){
const videoRef = useRef()
useEffect(() => {
function playOnMouseEnter(){
videoRef.current.play()
}
function pauseOnMouseEnter(){
videoRef.current.pause()
videoRef.current.currentTime = 0
}
if (videoRef.current){
videoRef.current.addEventListener("mouseenter", playOnMouseEnter)
videoRef.current.addEventListener("mouseleave", pauseOnMouseEnter)
}
return () => {
if (videoRef.current){
videoRef.current.removeEventListener("mouseenter", playOnMouseEnter)
videoRef.current.removeEventListener("mouseleave", pauseOnMouseEnter)
}
}
}, [videoRef])
return (
<>
{ file.fileType === "image" &&

}
{
file.fileType === "video" &&
}
{
file.fileType === "audio" &&
}
{
file.fileType === "others" &&
}
{file.name}
>
)
}