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}>
|
<Splitter className={'farmcontrol-splitter'} vertical={true}>
|
||||||
{collapseState.preview == true && (
|
{collapseState.preview == true && (
|
||||||
<Splitter.Panel style={{ height: '100%' }}>
|
<Splitter.Panel style={{ height: '100%' }}>
|
||||||
<Card
|
<Spin spinning={loading} indicator={<LoadingOutlined />}>
|
||||||
spinning={loading}
|
<Card
|
||||||
style={style}
|
spinning={loading}
|
||||||
styles={{ body: { height: '100%', padding: '22px' } }}
|
|
||||||
>
|
|
||||||
<TemplatePreview
|
|
||||||
objectData={objectData?.testObject}
|
|
||||||
documentTemplate={objectData}
|
|
||||||
loading={loading}
|
|
||||||
isEditing={isEditing}
|
|
||||||
style={style}
|
style={style}
|
||||||
onTestObjectOpen={() => setTestObjectOpen(true)}
|
styles={{ body: { height: '100%', padding: '22px' } }}
|
||||||
onPreviewMessage={handlePreviewMessage}
|
>
|
||||||
showTestObject={true}
|
<TemplatePreview
|
||||||
/>
|
objectData={objectData?.testObject}
|
||||||
</Card>
|
documentTemplate={objectData}
|
||||||
|
loading={loading}
|
||||||
|
isEditing={isEditing}
|
||||||
|
style={style}
|
||||||
|
onTestObjectOpen={() => setTestObjectOpen(true)}
|
||||||
|
onPreviewMessage={handlePreviewMessage}
|
||||||
|
showTestObject={true}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Spin>
|
||||||
</Splitter.Panel>
|
</Splitter.Panel>
|
||||||
)}
|
)}
|
||||||
{collapseState.editor == true && (
|
{collapseState.editor == true && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user