import { Popover } from "@components/popover" import { codeFileExtensions } from "@lib/constants" import clsx from "clsx" import type { File } from "lib/server/prisma" import styles from "./dropdown.module.css" import buttonStyles from "@components/button/button.module.css" import { ChevronDown, Code, File as FileIcon } from "react-feather" type Item = File & { icon: JSX.Element } const FileDropdown = ({ files }: { files: File[] }) => { const items = files.map((file) => { const extension = file.title.split(".").pop() if (codeFileExtensions.includes(extension || "")) { return { ...file, icon: } } else { return { ...file, icon: } } }) const content = ( ) return (
Jump to {files.length} {files.length === 1 ? "file" : "files"}
{content}
) } export default FileDropdown