import { getFileExtension } from "./file-extension";
import { DEFAULT_FILE_ICON, filetypeIconTable } from "./file-icons";
import { DEFAULT_ICON_FILL, filetypeFillColorTable, } from "./file-icon-fill-colors";
import { DEFAULT_ICON_BACKGROUND, filetypeBackgroundColorTable, } from "./file-icon-background-colors";
/**
 * Returns an icon with name, fill color, and background color
 * based on the file extension of the given filename.
 *
 * @param filename - the filename to get the icon for
 */
export function getFileIcon(filename) {
    const extension = getFileExtension(filename);
    return {
        name: filetypeIconTable[extension] || DEFAULT_FILE_ICON,
        color: filetypeFillColorTable[extension] || DEFAULT_ICON_FILL,
        backgroundColor: filetypeBackgroundColorTable[extension] || DEFAULT_ICON_BACKGROUND,
    };
}
