mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
77a65aaad8
- Replace all CSS custom properties with Tailwind utility classes - Add tailwind.config.js with custom color palette matching Linear design - Reduce index.css from 89 to 37 lines (58% reduction) - Maintain consistent visual appearance with semantic color usage - Update all components to use Tailwind classes instead of CSS variables
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { AppType } from "../lib/tauri-api";
|
|
import { Terminal, Code2 } from "lucide-react";
|
|
|
|
interface AppSwitcherProps {
|
|
activeApp: AppType;
|
|
onSwitch: (app: AppType) => void;
|
|
}
|
|
|
|
export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) {
|
|
const handleSwitch = (app: AppType) => {
|
|
if (app === activeApp) return;
|
|
onSwitch(app);
|
|
};
|
|
|
|
return (
|
|
<div className="inline-flex bg-gray-100 rounded-lg p-1 gap-1">
|
|
<button
|
|
type="button"
|
|
onClick={() => handleSwitch("claude")}
|
|
className={`inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 ${
|
|
activeApp === "claude"
|
|
? "bg-white text-gray-900 shadow-sm"
|
|
: "text-gray-500 hover:text-gray-900 hover:bg-white/50"
|
|
}`}
|
|
>
|
|
<Code2 size={16} />
|
|
<span>Claude Code</span>
|
|
</button>
|
|
|
|
<button
|
|
type="button"
|
|
onClick={() => handleSwitch("codex")}
|
|
className={`inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 ${
|
|
activeApp === "codex"
|
|
? "bg-white text-gray-900 shadow-sm"
|
|
: "text-gray-500 hover:text-gray-900 hover:bg-white/50"
|
|
}`}
|
|
>
|
|
<Terminal size={16} />
|
|
<span>Codex</span>
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|