import Button from "@components/button" import { Popover } from "@components/popover" import ShiftBy from "@components/shift-by" import ChevronDown from "@geist-ui/icons/chevronDown" import CodeIcon from "@geist-ui/icons/fileFunction" import FileIcon from "@geist-ui/icons/fileText" 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" 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