Files
9router/src/shared/components/Badge.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

55 lines
1.4 KiB
JavaScript

"use client";
import { cn } from "@/shared/utils/cn";
const variants = {
default: "bg-surface-2 text-text-muted",
primary: "bg-brand-500/10 text-brand-600 dark:text-brand-300",
success: "bg-green-500/10 text-green-600 dark:text-green-400",
warning: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",
error: "bg-red-500/10 text-red-600 dark:text-red-400",
info: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
};
const sizes = {
sm: "px-2 py-0.5 text-[10px]",
md: "px-2.5 py-1 text-xs",
lg: "px-3 py-1.5 text-sm",
};
export default function Badge({
children,
variant = "default",
size = "md",
dot = false,
icon,
className,
}) {
return (
<span
className={cn(
"inline-flex items-center gap-1.5 rounded-full font-semibold",
variants[variant],
sizes[size],
className
)}
>
{dot && (
<span
className={cn(
"size-1.5 rounded-full",
variant === "success" && "bg-green-500",
variant === "warning" && "bg-yellow-500",
variant === "error" && "bg-red-500",
variant === "info" && "bg-blue-500",
variant === "primary" && "bg-brand-500",
variant === "default" && "bg-gray-500"
)}
/>
)}
{icon && <span className="material-symbols-outlined text-[14px]">{icon}</span>}
{children}
</span>
);
}