Add function to get an icon from a file type

This commit is contained in:
sabaimran 2024-11-07 16:02:53 -08:00
parent 140c67f6b5
commit 92c3b9c502

View file

@ -49,6 +49,7 @@ import {
Gavel,
Broadcast,
KeyReturn,
FilePdf,
} from "@phosphor-icons/react";
import { Markdown, OrgMode, Pdf, Word } from "@/app/components/logo/fileLogo";
@ -216,6 +217,13 @@ export function getIconForSlashCommand(command: string, customClassName: string
return <ArrowRight className={className} />;
}
export function getIconFromFileType(fileType: string) {
if (fileType == "pdf") {
return <FilePdf className="w-6 h-6 text-muted-foreground inline-flex mr-1" />;
}
return <File className="w-6 h-6 text-muted-foreground inline-flex mr-1" />;
}
function getIconFromIconName(
iconName: string,
color: string = "gray",