2023-07-21 01:13:02 +00:00
|
|
|
|
import React from "react"
|
|
|
|
|
import { Center } from "@chakra-ui/react"
|
2023-08-22 11:31:37 +00:00
|
|
|
|
import emojis from "emojis-list"
|
2023-07-21 01:13:02 +00:00
|
|
|
|
|
|
|
|
|
export const Icon = (props) => {
|
2023-07-21 13:33:47 +00:00
|
|
|
|
const name = props?.name
|
|
|
|
|
|
2023-07-21 01:13:02 +00:00
|
|
|
|
const icon = React.useMemo(() => {
|
2023-07-21 13:33:47 +00:00
|
|
|
|
// nothing
|
|
|
|
|
if (["gear", "cog"]?.includes(name)) {
|
|
|
|
|
return "⚙️"
|
2023-07-21 01:13:02 +00:00
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["crystal"]?.includes(name)) {
|
|
|
|
|
return "🔮"
|
|
|
|
|
}
|
2023-08-13 05:53:47 +00:00
|
|
|
|
if (["flower", "hibiscus"]?.includes(name)) {
|
|
|
|
|
return "🌺"
|
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["sparke", "magic"]?.includes(name)) {
|
|
|
|
|
return "✨"
|
|
|
|
|
}
|
2023-08-14 02:58:50 +00:00
|
|
|
|
if (["wizard", "gandalf"]?.includes(name)) {
|
|
|
|
|
return "🧙♂️"
|
|
|
|
|
}
|
2023-08-15 23:10:13 +00:00
|
|
|
|
if (["two eyes"]?.includes(name)) {
|
|
|
|
|
return "👀"
|
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["box", "thing", "object"]?.includes(name)) {
|
|
|
|
|
return "📦"
|
|
|
|
|
}
|
2023-08-13 05:53:47 +00:00
|
|
|
|
if (["pencil"]?.includes(name)) {
|
|
|
|
|
return "✏️"
|
|
|
|
|
}
|
|
|
|
|
if (["edit", "paint", "create"]?.includes(name)) {
|
|
|
|
|
return "🎨"
|
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["book", "books"]?.includes(name)) {
|
|
|
|
|
return "📚"
|
|
|
|
|
}
|
2023-08-14 02:58:50 +00:00
|
|
|
|
if (["any", "magic wand"]?.includes(name)) {
|
|
|
|
|
return "🪄"
|
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["book-open", "books-open"]?.includes(name)) {
|
|
|
|
|
return "📖"
|
|
|
|
|
}
|
|
|
|
|
if (["book-reader", "books-reader"]?.includes(name)) {
|
|
|
|
|
return "👩🏫"
|
|
|
|
|
}
|
|
|
|
|
if (["number", "hundred"]?.includes(name)) {
|
|
|
|
|
return "💯"
|
|
|
|
|
}
|
2023-08-14 02:58:50 +00:00
|
|
|
|
if (["puzzle", "types"]?.includes(name)) {
|
|
|
|
|
return "🧩"
|
|
|
|
|
}
|
2023-07-21 13:33:47 +00:00
|
|
|
|
if (["heart"]?.includes(name)) {
|
|
|
|
|
return "❤️"
|
|
|
|
|
}
|
|
|
|
|
if (["heart-broken"]?.includes(name)) {
|
|
|
|
|
return "💔"
|
|
|
|
|
}
|
|
|
|
|
if (["heart-pulse"]?.includes(name)) {
|
|
|
|
|
return "💗"
|
|
|
|
|
}
|
|
|
|
|
if (["string", "text"]?.includes(name)) {
|
|
|
|
|
return "💬"
|
|
|
|
|
}
|
|
|
|
|
if (["array", "list"]?.includes(name)) {
|
|
|
|
|
return "📚"
|
|
|
|
|
}
|
|
|
|
|
if (["boolean", "bool"]?.includes(name)) {
|
|
|
|
|
return "🌗"
|
|
|
|
|
// return "⚖️"
|
|
|
|
|
}
|
2023-08-09 00:43:18 +00:00
|
|
|
|
if (["rainbow"]?.includes(name)) {
|
|
|
|
|
return "🌈"
|
|
|
|
|
}
|
|
|
|
|
if (["sun"]?.includes(name)) {
|
|
|
|
|
return "☀️"
|
|
|
|
|
}
|
|
|
|
|
if (["moon"]?.includes(name)) {
|
|
|
|
|
return "🌙"
|
|
|
|
|
}
|
|
|
|
|
if (["unicorn"]?.includes(name)) {
|
|
|
|
|
return "🦄"
|
|
|
|
|
}
|
|
|
|
|
if (["user", "person"]?.includes(name)) {
|
|
|
|
|
return "👤"
|
|
|
|
|
}
|
|
|
|
|
if (["group", "team"]?.includes(name)) {
|
|
|
|
|
return "👥"
|
|
|
|
|
}
|
|
|
|
|
if (["success", "check"]?.includes(name)) {
|
|
|
|
|
return "✅"
|
|
|
|
|
}
|
|
|
|
|
if (["error", "stop"]?.includes(name)) {
|
|
|
|
|
return "❌"
|
|
|
|
|
}
|
|
|
|
|
if (["warning", "alert"]?.includes(name)) {
|
|
|
|
|
return "⚠️"
|
|
|
|
|
}
|
|
|
|
|
if (["time", "clock"]?.includes(name)) {
|
|
|
|
|
return "⏰"
|
|
|
|
|
}
|
|
|
|
|
if (["star", "favorite"]?.includes(name)) {
|
|
|
|
|
return "⭐"
|
|
|
|
|
}
|
2023-08-13 05:53:47 +00:00
|
|
|
|
if (["glowing star", "glowing favorite"]?.includes(name)) {
|
|
|
|
|
return "🌟"
|
|
|
|
|
}
|
2023-08-09 00:43:18 +00:00
|
|
|
|
if (["question", "help"]?.includes(name)) {
|
|
|
|
|
return "❓"
|
|
|
|
|
}
|
|
|
|
|
if (["video", "media"]?.includes(name)) {
|
|
|
|
|
return "🎥"
|
|
|
|
|
}
|
|
|
|
|
if (["music", "audio"]?.includes(name)) {
|
|
|
|
|
return "🎵"
|
|
|
|
|
}
|
|
|
|
|
if (["image", "picture"]?.includes(name)) {
|
|
|
|
|
return "🖼️"
|
|
|
|
|
}
|
|
|
|
|
if (["email", "mail"]?.includes(name)) {
|
|
|
|
|
return "✉️"
|
|
|
|
|
}
|
|
|
|
|
if (["computer", "laptop"]?.includes(name)) {
|
|
|
|
|
return "💻"
|
|
|
|
|
}
|
|
|
|
|
if (["mobile", "phone"]?.includes(name)) {
|
|
|
|
|
return "📱"
|
|
|
|
|
}
|
|
|
|
|
if (["world", "globe"]?.includes(name)) {
|
|
|
|
|
return "🌍"
|
|
|
|
|
}
|
|
|
|
|
if (["rocket", "launch"]?.includes(name)) {
|
|
|
|
|
return "🚀"
|
|
|
|
|
}
|
|
|
|
|
if (["pencil", "edit"]?.includes(name)) {
|
|
|
|
|
return "✏️"
|
|
|
|
|
}
|
|
|
|
|
if (["search", "magnify"]?.includes(name)) {
|
|
|
|
|
return "🔍"
|
|
|
|
|
}
|
|
|
|
|
if (["lock", "secure"]?.includes(name)) {
|
|
|
|
|
return "🔒"
|
|
|
|
|
}
|
|
|
|
|
if (["unlock", "access"]?.includes(name)) {
|
|
|
|
|
return "🔓"
|
|
|
|
|
}
|
|
|
|
|
if (["thumb-up", "like"]?.includes(name)) {
|
|
|
|
|
return "👍"
|
|
|
|
|
}
|
|
|
|
|
if (["thumb-down", "dislike"]?.includes(name)) {
|
|
|
|
|
return "👎"
|
|
|
|
|
}
|
2023-08-12 12:22:52 +00:00
|
|
|
|
if (["plus", "add"]?.includes(name)) {
|
|
|
|
|
return "➕"
|
|
|
|
|
}
|
|
|
|
|
if (["seedling", "seed"]?.includes(name)) {
|
|
|
|
|
return "🌱"
|
|
|
|
|
}
|
2023-08-12 14:06:33 +00:00
|
|
|
|
if (["undefined", "null", "question", "confused"]?.includes(name)) {
|
2023-08-12 12:22:52 +00:00
|
|
|
|
return "❓"
|
|
|
|
|
// return "🌫️"
|
|
|
|
|
}
|
|
|
|
|
if (["codex", "robot", "ai", "chatgpt"]?.includes(name)) {
|
|
|
|
|
return "🤖"
|
|
|
|
|
}
|
2023-08-12 14:06:33 +00:00
|
|
|
|
if (["trash", "bin", "delete", "remove"]?.includes(name)) {
|
|
|
|
|
return "🗑️"
|
|
|
|
|
}
|
2023-08-14 01:34:50 +00:00
|
|
|
|
if (["cash", "money"]?.includes(name)) {
|
|
|
|
|
// return "💰"
|
|
|
|
|
return "💵"
|
|
|
|
|
}
|
|
|
|
|
if (["money bag"]?.includes(name)) {
|
|
|
|
|
return "💰"
|
|
|
|
|
}
|
2023-08-14 02:58:50 +00:00
|
|
|
|
if (["cyclone", "tornado"]?.includes(name)) {
|
|
|
|
|
return "🌀"
|
|
|
|
|
}
|
2023-08-09 00:52:25 +00:00
|
|
|
|
if (["thingtime"]?.includes(name)) {
|
2023-08-09 03:41:05 +00:00
|
|
|
|
if (Math.random() > 0.5) {
|
|
|
|
|
return "🌳"
|
|
|
|
|
}
|
2023-08-09 00:52:25 +00:00
|
|
|
|
return "🌀"
|
|
|
|
|
}
|
2023-08-22 11:31:37 +00:00
|
|
|
|
if (["function", "lambda"]?.includes(name)) {
|
|
|
|
|
return "📐"
|
|
|
|
|
}
|
|
|
|
|
if (["pin", "pinned", "located"]?.includes(name)) {
|
|
|
|
|
return "📌"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (["wrap", "wrapped"]?.includes(name)) {
|
|
|
|
|
return "🎁"
|
|
|
|
|
// return "🎀"
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-07 04:05:17 +00:00
|
|
|
|
if (["dinosaur", "dino"]?.includes(name)) {
|
|
|
|
|
return "🦕"
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-22 11:31:37 +00:00
|
|
|
|
if (emojis?.includes(name)) {
|
|
|
|
|
return name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (["random"]?.includes(name)) {
|
|
|
|
|
return emojis[Math.floor(Math.random() * emojis.length)]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// question mark
|
|
|
|
|
return "❓"
|
2023-07-21 13:33:47 +00:00
|
|
|
|
}, [name])
|
2023-07-21 01:13:02 +00:00
|
|
|
|
|
|
|
|
|
return (
|
2023-08-13 05:53:47 +00:00
|
|
|
|
<Center
|
|
|
|
|
transition="all 0.2s ease-out"
|
2023-08-14 10:32:14 +00:00
|
|
|
|
{...props}
|
2023-08-13 05:53:47 +00:00
|
|
|
|
{...props?.chakras}
|
|
|
|
|
fontSize={props?.size}
|
|
|
|
|
>
|
2023-07-21 13:33:47 +00:00
|
|
|
|
{icon}
|
2023-07-21 01:13:02 +00:00
|
|
|
|
</Center>
|
|
|
|
|
)
|
|
|
|
|
}
|