for consistency

This commit is contained in:
2026-02-11 14:10:35 -05:00
parent 2dfc96321b
commit 9a2b790897
2 changed files with 49 additions and 13 deletions

View File

@@ -0,0 +1,41 @@
import { useTheme } from "@/context/ThemeContext";
import type { JSXElement } from "solid-js";
import type { BoxOptions, TextOptions } from "@opentui/core";
export function SelectableBox({
selected,
children,
...props
}: {
selected: () => boolean;
children: JSXElement;
} & BoxOptions) {
const { theme } = useTheme();
return (
<box
borderColor={selected() ? theme.surface : theme.border}
backgroundColor={selected() ? theme.primary : theme.surface}
{...props}
>
{children}
</box>
);
}
export function SelectableText({
selected,
children,
...props
}: {
selected: () => boolean;
children: JSXElement;
} & TextOptions) {
const { theme } = useTheme();
return (
<text fg={selected() ? theme.surface : theme.text} {...props}>
{children}
</text>
);
}