import React from "react";
import { convertColorToTextClass } from "./colorUtils";
import {
Lightbulb,
Robot,
Aperture,
GraduationCap,
Jeep,
Island,
MathOperations,
Asclepius,
Couch,
Code,
Atom,
ClockCounterClockwise,
File,
Globe,
Palette,
Book,
Confetti,
House,
Translate,
Image,
BowlFood,
Lectern,
Wallet,
PencilLine,
Chalkboard,
Gps,
Question,
Browser,
Notebook,
Shapes,
ChatsTeardrop,
GlobeSimple,
ArrowRight,
Cigarette,
CraneTower,
Heart,
Leaf,
NewspaperClipping,
OrangeSlice,
SmileyMelting,
YinYang,
SneakerMove,
Student,
Oven,
Gavel,
Broadcast,
KeyReturn,
FilePdf,
FileMd,
MicrosoftWordLogo,
} from "@phosphor-icons/react";
import { OrgMode } from "@/app/components/logo/fileLogo";
interface IconMap {
[key: string]: (color: string, width: string, height: string) => JSX.Element | null;
}
const iconMap: IconMap = {
Lightbulb: (color: string, width: string, height: string) => (
),
Robot: (color: string, width: string, height: string) => (
),
Aperture: (color: string, width: string, height: string) => (
),
GraduationCap: (color: string, width: string, height: string) => (
),
Jeep: (color: string, width: string, height: string) => (
),
Island: (color: string, width: string, height: string) => (
),
MathOperations: (color: string, width: string, height: string) => (
),
Asclepius: (color: string, width: string, height: string) => (
),
Couch: (color: string, width: string, height: string) => (
),
Code: (color: string, width: string, height: string) => (
),
Atom: (color: string, width: string, height: string) => (
),
ClockCounterClockwise: (color: string, width: string, height: string) => (
),
Globe: (color: string, width: string, height: string) => (
),
Palette: (color: string, width: string, height: string) => (
),
Book: (color: string, width: string, height: string) => (
),
Confetti: (color: string, width: string, height: string) => (
),
House: (color: string, width: string, height: string) => (
),
Translate: (color: string, width: string, height: string) => (
),
BowlFood: (color: string, width: string, height: string) => (
),
Lectern: (color: string, width: string, height: string) => (
),
Wallet: (color: string, width: string, height: string) => (
),
PencilLine: (color: string, width: string, height: string) => (
),
Chalkboard: (color: string, width: string, height: string) => (
),
Cigarette: (color: string, width: string, height: string) => (
),
CraneTower: (color: string, width: string, height: string) => (
),
Heart: (color: string, width: string, height: string) => (
),
Leaf: (color: string, width: string, height: string) => (
),
NewspaperClipping: (color: string, width: string, height: string) => (
),
OrangeSlice: (color: string, width: string, height: string) => (
),
SmileyMelting: (color: string, width: string, height: string) => (
),
YinYang: (color: string, width: string, height: string) => (
),
SneakerMove: (color: string, width: string, height: string) => (
),
Student: (color: string, width: string, height: string) => (
),
Oven: (color: string, width: string, height: string) => (
),
Gavel: (color: string, width: string, height: string) => (
),
Broadcast: (color: string, width: string, height: string) => (
),
};
export function getIconForSlashCommand(command: string, customClassName: string | null = null) {
const className = customClassName ?? "h-4 w-4";
if (command.includes("summarize")) {
return ;
}
if (command.includes("help")) {
return ;
}
if (command.includes("automation")) {
return ;
}
if (command.includes("webpage")) {
return ;
}
if (command.includes("notes")) {
return ;
}
if (command.includes("image")) {
return ;
}
if (command.includes("default")) {
return ;
}
if (command.includes("diagram")) {
return ;
}
if (command.includes("general")) {
return ;
}
if (command.includes("online")) {
return ;
}
if (command.includes("text")) {
return ;
}
if (command.includes("code")) {
return ;
}
return ;
}
function getIconFromIconName(
iconName: string,
color: string = "gray",
width: string = "w-6",
height: string = "h-6",
) {
const icon = iconMap[iconName];
const colorName = color.toLowerCase();
const colorClass = convertColorToTextClass(colorName);
return icon ? icon(colorClass, width, height) : null;
}
function getIconFromFilename(
filename: string,
className: string = "w-6 h-6 text-muted-foreground inline-flex mr-1",
) {
const extension = filename.split(".").pop();
switch (extension) {
case "org":
return ;
case "markdown":
case "md":
return ;
case "pdf":
return ;
case "doc":
case "docx":
return ;
case "csv":
case "json":
return ;
case "txt":
return ;
case "py":
return ;
case "jpg":
case "jpeg":
case "png":
case "webp":
return ;
default:
return ;
}
}
function getAvailableIcons() {
return Object.keys(iconMap);
}
export { getIconFromIconName, getIconFromFilename, getAvailableIcons };