starting janitorial work

This commit is contained in:
2026-02-06 13:41:44 -05:00
parent 920042ee2a
commit 1293d30225
4 changed files with 383 additions and 298 deletions

View File

@@ -1,11 +1,17 @@
import { useTheme } from "../context/ThemeContext"
import { useTheme } from "../context/ThemeContext";
export type TabId = "feed" | "shows" | "discover" | "search" | "player" | "settings"
export type TabId =
| "feed"
| "shows"
| "discover"
| "search"
| "player"
| "settings";
export type TabDefinition = {
id: TabId
label: string
}
id: TabId;
label: string;
};
export const tabs: TabDefinition[] = [
{ id: "feed", label: "Feed" },
@@ -14,27 +20,31 @@ export const tabs: TabDefinition[] = [
{ id: "search", label: "Search" },
{ id: "player", label: "Player" },
{ id: "settings", label: "Settings" },
]
];
type TabProps = {
tab: TabDefinition
active: boolean
onSelect: (tab: TabId) => void
}
tab: TabDefinition;
active: boolean;
onSelect: (tab: TabId) => void;
};
export function Tab(props: TabProps) {
const { theme } = useTheme()
const { theme } = useTheme();
return (
<box
border
borderColor={theme.border}
onMouseDown={() => props.onSelect(props.tab.id)}
style={{ padding: 1, backgroundColor: props.active ? theme.primary : "transparent" }}
style={{
padding: 1,
backgroundColor: props.active ? theme.primary : "transparent",
}}
>
<text>
<text style={{ fg: theme.text }}>
{props.active ? "[" : " "}
{props.tab.label}
{props.active ? "]" : " "}
</text>
</box>
)
);
}