Files
weiguang-jewelry-ledger/新账系统/web/src/pages/CreateOrder/Section.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.1 KiB
TypeScript
Raw Normal View History

import type { ReactNode } from 'react';
import { Card } from 'antd';
import { Help, InternalTag } from './fields';
// 开单页分区卡片:编号(沿用旧界面 01 02… 的样式)、标题、可选说明与右侧操作;内部分区用金色左边框与暖色底。
export function Section({
step,
title,
help,
extra,
internal,
className,
testId,
children,
}: {
step: string;
title: ReactNode;
help?: ReactNode;
extra?: ReactNode;
internal?: boolean;
className?: string;
testId?: string;
children: ReactNode;
}) {
return (
<Card
className={'panel' + (internal ? ' panel-internal' : '') + (className ? ' ' + className : '')}
data-testid={testId}
title={
<div className="section-title">
<span className="step-no" aria-hidden="true">
{step}
</span>
<h2>{title}</h2>
{help ? <Help label={'关于' + (typeof title === 'string' ? title : '本区')}>{help}</Help> : null}
{internal ? <InternalTag /> : null}
</div>
}
extra={extra}
>
{children}
</Card>
);
}