9router/src/shared/components/SegmentedControl.js
decolua 6cdf40b44e Refactor global styles and enhance MITM functionality
- Updated global CSS to implement a new brand color palette and improve light/dark theme consistency.
- Enhanced the MitmServerCard component to provide clearer user feedback regarding admin privileges.
- Filtered LLM combos in the CombosPage to ensure only relevant data is displayed.
- Improved APIPageClient layout for better usability and visual consistency.
- Added functionality to save and load DNS tool states in the MITM manager.
- Updated OAuth configuration URLs for Qwen to reflect the new endpoint structure.
- Refined tunnel management logic to improve reliability and user experience.
2026-05-03 18:00:35 +07:00

48 lines
1.1 KiB
JavaScript

"use client";
import { cn } from "@/shared/utils/cn";
export default function SegmentedControl({
options = [],
value,
onChange,
size = "md",
className,
}) {
const sizes = {
sm: "h-7 text-xs",
md: "h-9 text-sm",
lg: "h-11 text-base",
};
return (
<div
className={cn(
"inline-flex items-center p-1 rounded-[10px] overflow-x-auto",
"bg-surface-2",
className
)}
>
{options.map((option) => (
<button
key={option.value}
onClick={() => onChange(option.value)}
className={cn(
"shrink-0 px-4 rounded-[8px] font-medium transition-all",
sizes[size],
value === option.value
? "bg-surface text-text-main shadow-sm"
: "text-text-muted hover:text-text-main"
)}
>
{option.icon && (
<span className="material-symbols-outlined text-[16px] mr-1.5">
{option.icon}
</span>
)}
{option.label}
</button>
))}
</div>
);
}