60 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-07-21 01:13:02 +00:00
import React from "react"
import { Center } from "@chakra-ui/react"
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 "🔮"
}
if (["sparke", "magic"]?.includes(name)) {
return "✨"
}
if (["box", "thing", "object"]?.includes(name)) {
return "📦"
}
if (["book", "books"]?.includes(name)) {
return "📚"
}
if (["book-open", "books-open"]?.includes(name)) {
return "📖"
}
if (["book-reader", "books-reader"]?.includes(name)) {
return "👩‍🏫"
}
if (["number", "hundred"]?.includes(name)) {
return "💯"
}
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 "⚖️"
}
}, [name])
2023-07-21 01:13:02 +00:00
return (
2023-07-21 13:33:47 +00:00
<Center {...props?.chakras} fontSize={props?.size}>
{icon}
2023-07-21 01:13:02 +00:00
</Center>
)
}