2025-08-31 21:27:58 +08:00
|
|
|
import { AppType } from "../lib/tauri-api";
|
2025-09-13 16:21:15 +08:00
|
|
|
import { ClaudeIcon, CodexIcon } from "./BrandIcons";
|
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-08 15:57:29 +08:00
|
|
|
<div className="inline-flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1 gap-1 border border-transparent dark:border-gray-700">
|
2025-08-31 21:27:58 +08:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => handleSwitch("claude")}
|
2025-09-16 20:16:55 +08:00
|
|
|
className={`group inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 ${
|
2025-09-06 16:21:21 +08:00
|
|
|
activeApp === "claude"
|
2025-09-08 15:57:29 +08:00
|
|
|
? "bg-white text-gray-900 shadow-sm dark:bg-gray-900 dark:text-gray-100 dark:shadow-none"
|
|
|
|
|
: "text-gray-500 hover:text-gray-900 hover:bg-white/50 dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800/60"
|
2025-09-06 16:21:21 +08:00
|
|
|
}`}
|
2025-08-31 21:27:58 +08:00
|
|
|
>
|
2025-09-13 16:21:15 +08:00
|
|
|
<ClaudeIcon
|
|
|
|
|
size={16}
|
|
|
|
|
className={
|
2025-09-18 22:33:55 +08:00
|
|
|
activeApp === "claude"
|
|
|
|
|
? "text-[#D97757] dark:text-[#D97757] transition-colors duration-200"
|
2025-09-16 20:16:55 +08:00
|
|
|
: "text-gray-500 dark:text-gray-400 group-hover:text-[#D97757] dark:group-hover:text-[#D97757] transition-colors duration-200"
|
2025-09-13 16:21:15 +08:00
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<span>Claude</span>
|
2025-08-31 21:27:58 +08:00
|
|
|
</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"
|
2025-09-08 15:57:29 +08:00
|
|
|
? "bg-white text-gray-900 shadow-sm dark:bg-gray-900 dark:text-gray-100 dark:shadow-none"
|
|
|
|
|
: "text-gray-500 hover:text-gray-900 hover:bg-white/50 dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800/60"
|
2025-09-06 16:21:21 +08:00
|
|
|
}`}
|
2025-08-31 21:27:58 +08:00
|
|
|
>
|
2025-09-13 16:21:15 +08:00
|
|
|
<CodexIcon size={16} />
|
2025-08-31 21:27:58 +08:00
|
|
|
<span>Codex</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2025-09-05 21:26:01 +08:00
|
|
|
}
|