"use client" import Image from "next/image" import { getIconForFile } from "vscode-icons-js" import { TFile } from "./types" import { useEffect, useState } from "react" export default function SidebarFile({ data, selectFile, }: { data: TFile selectFile: (file: TFile) => void }) { const [imgSrc, setImgSrc] = useState(`/icons/${getIconForFile(data.name)}`) return ( ) }