Refactor TemplateEditor to Improve Loading State Handling
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:
Tom Butcher 2026-08-21 23:15:47 +01:00
parent 53d488011b
commit f55a09ff1f

View File

@ -187,6 +187,7 @@ 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%' }}>
<Spin spinning={loading} indicator={<LoadingOutlined />}>
<Card <Card
spinning={loading} spinning={loading}
style={style} style={style}
@ -203,6 +204,7 @@ const TemplateEditor = ({
showTestObject={true} showTestObject={true}
/> />
</Card> </Card>
</Spin>
</Splitter.Panel> </Splitter.Panel>
)} )}
{collapseState.editor == true && ( {collapseState.editor == true && (