ratkit 0.2.16

A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
Documentation
"use client";
import { createContext, useContext } from "react";

interface ThemeContextValue {
	serverTheme: string;
}

const ThemeContext = createContext<ThemeContextValue>({ serverTheme: "dark" });

export function ThemeProvider({
	children,
	theme,
}: {
	children: React.ReactNode;
	theme: string;
}) {
	return (
		<ThemeContext.Provider value={{ serverTheme: theme }}>
			{children}
		</ThemeContext.Provider>
	);
}

export function useServerTheme() {
	return useContext(ThemeContext);
}