mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Add function to get an icon from a file type
This commit is contained in:
parent
140c67f6b5
commit
92c3b9c502
1 changed files with 8 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue