2025-10-30 14:59:15 +08:00
|
|
|
import type { AppId } from "@/lib/api";
|
2025-09-13 16:21:15 +08:00
|
|
|
import { ClaudeIcon, CodexIcon } from "./BrandIcons";
|
2025-08-31 21:27:58 +08:00
|
|
|
|
|
|
|
|
interface AppSwitcherProps {
|
2025-10-30 14:59:15 +08:00
|
|
|
activeApp: AppId;
|
|
|
|
|
onSwitch: (app: AppId) => void;
|
2025-08-31 21:27:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AppSwitcher({ activeApp, onSwitch }: AppSwitcherProps) {
|
2025-10-30 14:59:15 +08:00
|
|
|
const handleSwitch = (app: AppId) => {
|
2025-08-31 21:27:58 +08:00
|
|
|
if (app === activeApp) return;
|
|
|
|
|
onSwitch(app);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
refactor: implement unified border design system
- Define custom border utilities in @layer utilities for consistent theming
- Add border-default (1px gray), border-active (2px primary), border-hover (40% primary), and border-dragging (60% primary) classes
- Update all UI components (Input, Select, TextArea, Button, Dialog, Dropdown) to use unified border classes
- Replace hardcoded border colors (gray-200/300/600/700) with theme-responsive border-border-default
- Update provider cards, MCP components, settings, and forms with new border system
- Remove dark mode border overrides to simplify CSS and improve maintainability
- Ensure all borders automatically adapt to light/dark themes via CSS variables
2025-10-20 23:44:06 +08:00
|
|
|
<div className="inline-flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1 gap-1 border border-transparent ">
|
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
|
|
|
}
|