Refactor TemplateEditor to Improve Loading State Handling
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Wrapped the TemplatePreview component in a Spin component to provide a loading indicator while content is being loaded. - Enhanced the structure of the TemplatePreview component by ensuring proper style and props are passed, improving user experience during loading states.
This commit is contained in:
parent
53d488011b
commit
f55a09ff1f
@ -187,22 +187,24 @@ const TemplateEditor = ({
|
||||
<Splitter className={'farmcontrol-splitter'} vertical={true}>
|
||||
{collapseState.preview == true && (
|
||||
<Splitter.Panel style={{ height: '100%' }}>
|
||||
<Card
|
||||
spinning={loading}
|
||||
style={style}
|
||||
styles={{ body: { height: '100%', padding: '22px' } }}
|
||||
>
|
||||
<TemplatePreview
|
||||
objectData={objectData?.testObject}
|
||||
documentTemplate={objectData}
|
||||
loading={loading}
|
||||
isEditing={isEditing}
|
||||
<Spin spinning={loading} indicator={<LoadingOutlined />}>
|
||||
<Card
|
||||
spinning={loading}
|
||||
style={style}
|
||||
onTestObjectOpen={() => setTestObjectOpen(true)}
|
||||
onPreviewMessage={handlePreviewMessage}
|
||||
showTestObject={true}
|
||||
/>
|
||||
</Card>
|
||||
styles={{ body: { height: '100%', padding: '22px' } }}
|
||||
>
|
||||
<TemplatePreview
|
||||
objectData={objectData?.testObject}
|
||||
documentTemplate={objectData}
|
||||
loading={loading}
|
||||
isEditing={isEditing}
|
||||
style={style}
|
||||
onTestObjectOpen={() => setTestObjectOpen(true)}
|
||||
onPreviewMessage={handlePreviewMessage}
|
||||
showTestObject={true}
|
||||
/>
|
||||
</Card>
|
||||
</Spin>
|
||||
</Splitter.Panel>
|
||||
)}
|
||||
{collapseState.editor == true && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user