feat(ui): enhance table and admin components with improved layout and status display

- Updated global CSS to center-align table headers and cells, ensuring a consistent layout.
- Modified admin table components to replace switches with status badges for better clarity.
- Enhanced internationalization support by adding new strings for version actions and validation messages in multiple locales.
- Refactored configuration document screens to include version selection and improved user feedback on status changes.
This commit is contained in:
2026-05-26 11:13:16 +08:00
parent 05fa0cbeec
commit 4080f0b601
38 changed files with 788 additions and 608 deletions

View File

@@ -12,6 +12,7 @@ type ConfigDocPageProps = {
/** Category / play-type chips etc., rendered above the version toolbar. */
filters?: ReactNode;
toolbar?: ReactNode;
/** @deprecated Pass `footer` on `ConfigDocToolbar` instead. */
context?: ReactNode;
children: ReactNode;
className?: string;
@@ -21,23 +22,29 @@ type ConfigDocPageProps = {
export function ConfigDocToolbar({
switcher,
actions,
footer,
className,
}: {
switcher: ReactNode;
actions: ReactNode;
/** Live version / read-only hint — rendered as a subtle line under the main row. */
footer?: ReactNode;
className?: string;
}) {
return (
<div
className={cn(
"rounded-xl border border-border/60 bg-secondary/50 p-4 shadow-sm",
"overflow-hidden rounded-xl border border-border/60 bg-card",
className,
)}
>
<div className="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div className="flex flex-col gap-3 p-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:p-4">
<div className="min-w-0 flex-1">{switcher}</div>
<div className="flex shrink-0 flex-wrap items-center justify-end gap-2">{actions}</div>
<div className="flex shrink-0 flex-wrap items-center gap-1.5 sm:justify-end">{actions}</div>
</div>
{footer ? (
<div className="border-t border-border/50 bg-muted/20 px-3 py-2.5 sm:px-4">{footer}</div>
) : null}
</div>
);
}
@@ -65,8 +72,8 @@ export function ConfigDocPage({
{description ? <CardDescription className="text-base">{description}</CardDescription> : null}
</CardHeader>
<CardContent className={cn("space-y-6 pt-6", contentClassName)}>
{filters}
{toolbar}
{filters}
{context}
{children}
</CardContent>