parent
7628f54c4c
commit
5c4539f06c
2 changed files with 49 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||||||
|
import { FC, useMemo } from 'react'; |
||||||
|
|
||||||
|
import CommonFenceInputGroup from './CommonFenceInputGroup'; |
||||||
|
import Spinner from './Spinner'; |
||||||
|
|
||||||
|
const EditFenceInputGroup: FC<EditFenceInputGroupProps> = ({ |
||||||
|
fenceId, |
||||||
|
fenceTemplate: externalFenceTemplate, |
||||||
|
loading: isExternalLoading, |
||||||
|
previousFenceName, |
||||||
|
previousFenceParameters, |
||||||
|
}) => { |
||||||
|
const content = useMemo( |
||||||
|
() => |
||||||
|
isExternalLoading ? ( |
||||||
|
<Spinner /> |
||||||
|
) : ( |
||||||
|
<CommonFenceInputGroup |
||||||
|
fenceId={fenceId} |
||||||
|
fenceTemplate={externalFenceTemplate} |
||||||
|
previousFenceName={previousFenceName} |
||||||
|
previousFenceParameters={previousFenceParameters} |
||||||
|
/> |
||||||
|
), |
||||||
|
[ |
||||||
|
externalFenceTemplate, |
||||||
|
fenceId, |
||||||
|
isExternalLoading, |
||||||
|
previousFenceName, |
||||||
|
previousFenceParameters, |
||||||
|
], |
||||||
|
); |
||||||
|
|
||||||
|
return <>{content}</>; |
||||||
|
}; |
||||||
|
|
||||||
|
export default EditFenceInputGroup; |
@ -0,0 +1,12 @@ |
|||||||
|
type EditFenceInputGroupOptionalProps = { |
||||||
|
fenceTemplate?: APIFenceTemplate; |
||||||
|
loading?: boolean; |
||||||
|
}; |
||||||
|
|
||||||
|
type EditFenceInputGroupProps = EditFenceInputGroupOptionalProps & |
||||||
|
Required< |
||||||
|
Pick< |
||||||
|
CommonFenceInputGroupProps, |
||||||
|
'fenceId' | 'previousFenceName' | 'previousFenceParameters' |
||||||
|
> |
||||||
|
>; |
Loading…
Reference in new issue