refactor(web): 采用 Button/Card 原语替换多处手搓样式

This commit is contained in:
Yaojia Wang
2026-06-29 16:52:43 +02:00
parent 47eb42f274
commit d7fcb8a329
12 changed files with 71 additions and 44 deletions

View File

@@ -4,6 +4,7 @@ import { useCallback, useEffect, useState } from "react";
import { ConflictCard } from "@/components/review/ConflictCard";
import { useToast } from "@/components/Toast";
import { Button } from "@/components/ui/Button";
import { api } from "@/lib/api/client";
import { buildResumeRequest } from "@/lib/chain/chain";
import { friendlyFromApiError } from "@/lib/errors/messages";
@@ -159,14 +160,14 @@ export function ChainAdjudication({
</ul>
)}
<button
type="button"
<Button
variant="primary"
onClick={() => void onResume()}
disabled={resuming || !allResolved(drafts)}
className="self-start rounded bg-cinnabar px-4 py-2 text-sm text-white disabled:opacity-50"
className="self-start"
>
{resuming ? "续跑中…" : "裁决完成,续跑"}
</button>
</Button>
{pending.length > 0 ? (
<p className="text-xs text-conflict">
{pending.length}

View File

@@ -1,5 +1,6 @@
"use client";
import { Card } from "@/components/ui/Card";
import type { ChainPhase, ChainResultView } from "@/lib/chain/chain";
interface ChainProgressProps {
@@ -18,8 +19,9 @@ const PHASE_LABEL: Record<ChainPhase, string> = {
// 链进度视图:相位徽标 + 进度条 + 已写章号清单token/正文绝不展示result 只含元数据)。
export function ChainProgress({ phase, progress, result }: ChainProgressProps) {
return (
<section
className="flex flex-col gap-3 rounded border border-line bg-panel p-5"
<Card
as="section"
className="flex flex-col gap-3 p-5"
aria-label="链进度"
>
<div className="flex items-center justify-between gap-3">
@@ -58,6 +60,6 @@ export function ChainProgress({ phase, progress, result }: ChainProgressProps) {
{result.awaitingChapter}
</p>
) : null}
</section>
</Card>
);
}