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:
@@ -39,32 +39,44 @@ export function ConfigVersionActions({
|
||||
const resolvedPublishLabel = publishLabel ?? t("versionActions.publishCurrent");
|
||||
|
||||
return (
|
||||
<div className={cn("flex flex-wrap items-center gap-2", className)}>
|
||||
<Button type="button" variant="outline" disabled={loadingList} onClick={onRefresh}>
|
||||
<RefreshCw className={loadingList ? "size-4 animate-spin" : "size-4"} aria-hidden />
|
||||
{loadingList ? t("versionActions.refreshing") : t("versionActions.refresh")}
|
||||
<div className={cn("flex flex-wrap items-center gap-1", className)}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
disabled={loadingList}
|
||||
onClick={onRefresh}
|
||||
aria-label={loadingList ? t("versionActions.refreshing") : t("versionActions.refresh")}
|
||||
title={loadingList ? t("versionActions.refreshing") : t("versionActions.refresh")}
|
||||
>
|
||||
<RefreshCw className={cn("size-4", loadingList && "animate-spin")} aria-hidden />
|
||||
</Button>
|
||||
|
||||
{canManage ? (
|
||||
<Button type="button" disabled={saving} onClick={onNewDraft}>
|
||||
<Plus className="size-4" aria-hidden />
|
||||
{t("versionActions.newDraft")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canManage && isDraft ? (
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
disabled={draftActionBusy}
|
||||
onClick={onSaveDraft}
|
||||
>
|
||||
<Save className="size-4" aria-hidden />
|
||||
{t("versionActions.saveDraft")}
|
||||
</Button>
|
||||
<Button type="button" disabled={draftActionBusy} onClick={onPublish}>
|
||||
<Rocket className="size-4" aria-hidden />
|
||||
{resolvedPublishLabel}
|
||||
<span className="mx-0.5 hidden h-5 w-px bg-border/60 sm:block" aria-hidden />
|
||||
<Button type="button" variant="outline" size="sm" disabled={saving} onClick={onNewDraft}>
|
||||
<Plus className="size-3.5" aria-hidden />
|
||||
{t("versionActions.newDraft")}
|
||||
</Button>
|
||||
{isDraft ? (
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={draftActionBusy}
|
||||
onClick={onSaveDraft}
|
||||
>
|
||||
<Save className="size-3.5" aria-hidden />
|
||||
{t("versionActions.saveDraft")}
|
||||
</Button>
|
||||
<Button type="button" size="sm" disabled={draftActionBusy} onClick={onPublish}>
|
||||
<Rocket className="size-3.5" aria-hidden />
|
||||
{resolvedPublishLabel}
|
||||
</Button>
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user