mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Add function to get an icon from a file type
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user