import { RGBA, TextAttributes } from "@opentui/core"
import { For, type JSX } from "solid-js"
import { tint, useTheme } from "../context/theme"
import { logo } from "../logo"
export function Logo() {
const { theme } = useTheme()
const renderLine = (line: string, fg: RGBA, bold: boolean): JSX.Element[] => {
const shadow = tint(theme.background, fg, 0.25)
const attrs = bold ? TextAttributes.BOLD : undefined
return Array.from(line).map((char) => {
if (char === "_") {
return (
{" "}
)
}
if (char === "^") {
return (
▀
)
}
if (char === "~") {
return (
▀
)
}
if (char === ",") {
return (
▄
)
}
return (
{char}
)
})
}
return (
{(line, index) => (
{renderLine(line, theme.textMuted, false)}
{renderLine(logo.right[index()], theme.text, true)}
)}
)
}