import { useStore } from '../store/context'
/** 生成卡片:head / lines / foot / tips,foot 按钮为真实 React 事件 */
export default function GenCardView({ gen, confirm }) {
const { applyGen, regen, showToast, serialConfirm, serialRegen, countdown } = useStore()
const { card } = gen
const serial = !!confirm
const body = (
{card.head}
{card.lines.map((l, i) => )}
{card.foot && (
{card.foot.regen && }
)}
{card.tips.length > 0 && (
{card.tips.map((t, i) => {t.text})}
)}
)
/* 串行流程:外层包 serial-card,底部附确认栏 */
if (serial) {
return (
{body}
{confirm.status === 'confirmed' ? (
✓ 已确认,填入表单中…
) : (
{confirm.mode
? {countdown}s 后自动确认
: ⏸ 等待您确认…}
)}
)
}
return (
)
}