mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Add function to get an icon from a file type
This commit is contained in:
@@ -49,6 +49,7 @@ import {
|
|||||||
Gavel,
|
Gavel,
|
||||||
Broadcast,
|
Broadcast,
|
||||||
KeyReturn,
|
KeyReturn,
|
||||||
|
FilePdf,
|
||||||
} from "@phosphor-icons/react";
|
} from "@phosphor-icons/react";
|
||||||
import { Markdown, OrgMode, Pdf, Word } from "@/app/components/logo/fileLogo";
|
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} />;
|
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(
|
function getIconFromIconName(
|
||||||
iconName: string,
|
iconName: string,
|
||||||
color: string = "gray",
|
color: string = "gray",
|
||||||
|
|||||||
Reference in New Issue
Block a user