in src/ui/widget/SegmentEditSwitch.tsx [26:43]
export function SegmentEditSwitch(props:SegmentEditSwitchProps): JSX.Element{
let disable = false, saving = false;
switch(props.state){
// @ts-ignore
case "disable":
disable = true;
// eslint-disable-next-line no-fallthrough
case "readable":
return <Button value="edit" disabled={disable} onClick={()=>props.onClick(true)}>编辑</Button>
// @ts-ignore
case "saving":
saving = true;
// eslint-disable-next-line no-fallthrough
case "editor":
// @ts-ignore
return <Radio.Group>
<Radio.Button disabled={saving} value="save" onClick={()=>props.onClick(true)}>{saving?<LoadingOutlined />:undefined} 提交</Radio.Button>
<Radio.Button key="c" value="cancel" onClick={()=>props.onClick(false)}>取消</Radio.Button>