auto-sync: 2026-05-21 20:07:49
This commit is contained in:
@@ -181,28 +181,21 @@ function StatusButtons({ status, taskId, onAction }: { status: string; taskId: s
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const btn = (b: typeof primary[0]) => (
|
const btn = (b: typeof buttons[0]) => (
|
||||||
<button key={b.target} onClick={() => handleClick(b.target)} disabled={!!loading} style={{
|
<button key={b.target} onClick={() => handleClick(b.target)} disabled={!!loading} style={{
|
||||||
padding: '5px 12px', borderRadius: 6, fontSize: 11, cursor: loading ? 'not-allowed' : 'pointer',
|
padding: '5px 12px', borderRadius: 6, fontSize: 11, cursor: loading ? 'not-allowed' : 'pointer',
|
||||||
background: b.bg, color: b.color, border: `1px solid ${b.border}`, fontWeight: 600, opacity: loading === b.target ? 0.6 : 1,
|
background: b.bg, color: b.color, border: `1px solid ${b.border}`, fontWeight: 600, opacity: loading === b.target ? 0.6 : 1,
|
||||||
}}>{loading === b.target ? '⏳' : b.icon} {b.label}</button>
|
}}>{loading === b.target ? '⏳' : b.icon} {b.label}</button>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (buttons.length === 0) {
|
||||||
|
return <div style={{ fontSize: 12, color: 'var(--muted)', padding: '4px 0' }}>-</div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>{primary.map(b => btn(b))}</div>
|
<div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>{buttons.map(b => btn(b))}</div>
|
||||||
{advanced.length > 0 && (
|
</div>
|
||||||
<div style={{ marginTop: 6 }}>
|
|
||||||
{!showAdvanced ? (
|
|
||||||
<button onClick={() => setShowAdvanced(true)} style={{ fontSize: 10, color: 'var(--muted)', background: 'none', border: 'none', cursor: 'pointer', padding: '2px 0' }}>
|
|
||||||
▸ 高级操作
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<div style={{ display: 'flex', gap: 6, flexWrap: 'wrap', padding: '4px 0', borderTop: '1px dashed var(--line)', marginTop: 4 }}>
|
|
||||||
{advanced.map(b => btn(b))}
|
|
||||||
<button onClick={() => setShowAdvanced(false)} style={{ fontSize: 10, color: 'var(--muted)', background: 'none', border: 'none', cursor: 'pointer' }}>收起</button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user