mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
- 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.
117 lines
2.6 KiB
JavaScript
117 lines
2.6 KiB
JavaScript
"use client";
|
|
|
|
import { cn } from "@/shared/utils/cn";
|
|
|
|
export default function Card({
|
|
children,
|
|
title,
|
|
subtitle,
|
|
icon,
|
|
action,
|
|
padding = "md",
|
|
hover = false,
|
|
elev = false,
|
|
className,
|
|
...props
|
|
}) {
|
|
const paddings = {
|
|
none: "",
|
|
xs: "p-3",
|
|
sm: "p-4",
|
|
md: "p-6",
|
|
lg: "p-8",
|
|
};
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"bg-surface border border-border-subtle",
|
|
elev ? "rounded-[14px] shadow-[var(--shadow-elev)]" : "rounded-[14px] shadow-[var(--shadow-soft)]",
|
|
hover && "hover:shadow-[var(--shadow-warm)] hover:border-brand-500/30 transition-all cursor-pointer",
|
|
paddings[padding],
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{(title || action) && (
|
|
<div className="flex items-center justify-between mb-4">
|
|
<div className="flex items-center gap-3">
|
|
{icon && (
|
|
<div className="p-2 rounded-[10px] bg-bg text-text-muted">
|
|
<span className="material-symbols-outlined text-[20px]">{icon}</span>
|
|
</div>
|
|
)}
|
|
<div>
|
|
{title && (
|
|
<h3 className="text-text-main font-semibold">{title}</h3>
|
|
)}
|
|
{subtitle && (
|
|
<p className="text-sm text-text-muted">{subtitle}</p>
|
|
)}
|
|
</div>
|
|
</div>
|
|
{action}
|
|
</div>
|
|
)}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
Card.Section = function CardSection({ children, className, ...props }) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"p-4 rounded-[10px]",
|
|
"bg-bg border border-border-subtle",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
Card.Row = function CardRow({ children, className, ...props }) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"p-3 -mx-3 px-3 transition-colors",
|
|
"border-b border-border-subtle last:border-b-0",
|
|
"hover:bg-surface-2/50",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
Card.ListItem = function CardListItem({
|
|
children,
|
|
actions,
|
|
className,
|
|
...props
|
|
}) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"group flex items-center justify-between p-3 -mx-3 px-3",
|
|
"border-b border-border-subtle last:border-b-0",
|
|
"hover:bg-surface-2/50 transition-colors",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
<div className="flex-1 min-w-0">{children}</div>
|
|
{actions && (
|
|
<div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
|
|
{actions}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|