mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(dashboard): show custom theme palette swatches
This commit is contained in:
parent
239ea1bdea
commit
da8654bb41
2 changed files with 18 additions and 13 deletions
|
|
@ -311,9 +311,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|||
|
||||
/** All selectable themes (shown in the picker). Starts with just the
|
||||
* built-ins; the API call below merges in user themes. */
|
||||
const [availableThemes, setAvailableThemes] = useState<
|
||||
Array<{ description: string; label: string; name: string }>
|
||||
>(() =>
|
||||
const [availableThemes, setAvailableThemes] = useState<ThemeSummary[]>(() =>
|
||||
Object.values(BUILTIN_THEMES).map((t) => ({
|
||||
name: t.name,
|
||||
label: t.label,
|
||||
|
|
@ -360,6 +358,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|||
name: t.name,
|
||||
label: t.label,
|
||||
description: t.description,
|
||||
definition: t.definition,
|
||||
})),
|
||||
);
|
||||
// Index any definitions the server shipped (user themes).
|
||||
|
|
@ -430,8 +429,15 @@ const ThemeContext = createContext<ThemeContextValue>({
|
|||
});
|
||||
|
||||
interface ThemeContextValue {
|
||||
availableThemes: Array<{ description: string; label: string; name: string }>;
|
||||
availableThemes: ThemeSummary[];
|
||||
setTheme: (name: string) => void;
|
||||
theme: DashboardTheme;
|
||||
themeName: string;
|
||||
}
|
||||
|
||||
interface ThemeSummary {
|
||||
description: string;
|
||||
label: string;
|
||||
name: string;
|
||||
definition?: DashboardTheme;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue