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