Files
OmniRoute/src/shared/components/ThemeToggle.tsx
diegosouzapw 71d14209a4 feat: OmniRoute v1.0.0 — Intelligent AI Gateway & Universal LLM Proxy
OmniRoute is an intelligent API gateway that unifies 20+ AI providers behind a single
OpenAI-compatible endpoint. Features include intelligent routing with 6 strategies,
multi-format translation (OpenAI/Claude/Gemini/Responses API), circuit breakers,
semantic caching, combo fallback chains, real-time health monitoring, and a full
dashboard with provider management, analytics, and CLI tool integration.

Key highlights:
- 20+ providers (Claude Code, Codex, Gemini CLI, GitHub Copilot, iFlow, Qwen, Kiro, etc.)
- 6 routing strategies (Fill First, Round Robin, P2C, Random, Least Used, Cost Optimized)
- Export/Import database backup with full archive support
- Translator Playground with 4 modes (Playground, Chat Tester, Test Bench, Live Monitor)
- 100% TypeScript across src/ and open-sse/
- Docker support with multi-stage builds
- Comprehensive documentation and 9 dashboard screenshots
2026-02-18 00:02:15 -03:00

47 lines
1.3 KiB
TypeScript

"use client";
import { useTheme } from "@/shared/hooks/useTheme";
import { cn } from "@/shared/utils/cn";
export default function ThemeToggle({ className, variant = "default" }: { className?: any; variant?: string }) {
const { theme, toggleTheme, isDark } = useTheme();
const variants = {
default: cn(
"flex items-center justify-center size-10 rounded-full",
"text-text-muted",
"hover:bg-black/5",
"hover:text-text-main",
"transition-colors"
),
card: cn(
"flex items-center justify-center size-11 rounded-full",
"bg-surface/60",
"hover:bg-surface",
"border border-border",
"backdrop-blur-md shadow-sm hover:shadow-md",
"text-text-muted-light hover:text-primary",
"hover:text-primary",
"transition-all group"
),
};
return (
<button
onClick={toggleTheme}
className={cn(variants[variant], className)}
aria-label={`Switch to ${isDark ? "light" : "dark"} mode`}
title={`Switch to ${isDark ? "light" : "dark"} mode`}
>
<span
className={cn(
"material-symbols-outlined text-[22px]",
variant === "card" && "transition-transform duration-300 group-hover:rotate-12"
)}
>
{isDark ? "light_mode" : "dark_mode"}
</span>
</button>
);
}