2025-08-31 21:27:58 +08:00
|
|
|
import { AppType } from "../lib/tauri-api";
|
2025-09-06 16:21:21 +08:00
|
|
|
import { Terminal, Code2 } from "lucide-react";
|
2025-08-31 21:27:58 +08:00
|
|
|
|
|
|
|
|
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 (
|
2025-09-06 16:21:21 +08:00
|
|
|
<div className="inline-flex bg-[var(--color-bg-tertiary)] rounded-lg p-1 gap-1">
|
2025-08-31 21:27:58 +08:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => handleSwitch("claude")}
|
2025-09-06 16:21:21 +08:00
|
|
|
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-[var(--color-text-primary)] shadow-sm"
|
|
|
|
|
: "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] hover:bg-white/50"
|
|
|
|
|
}`}
|
2025-08-31 21:27:58 +08:00
|
|
|
>
|
2025-09-06 16:21:21 +08:00
|
|
|
<Code2 size={16} />
|
2025-08-31 21:27:58 +08:00
|
|
|
<span>Claude Code</span>
|
|
|
|
|
</button>
|
2025-09-06 16:21:21 +08:00
|
|
|
|
2025-08-31 21:27:58 +08:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => handleSwitch("codex")}
|
2025-09-06 16:21:21 +08:00
|
|
|
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-[var(--color-text-primary)] shadow-sm"
|
|
|
|
|
: "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] hover:bg-white/50"
|
|
|
|
|
}`}
|
2025-08-31 21:27:58 +08:00
|
|
|
>
|
2025-09-06 16:21:21 +08:00
|
|
|
<Terminal size={16} />
|
2025-08-31 21:27:58 +08:00
|
|
|
<span>Codex</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2025-09-05 21:26:01 +08:00
|
|
|
}
|