anvil/striker-ui/components/ManageFence/EditFenceInputGroup.tsx
Tsu-ba-me 488ed99370 fix(striker-ui): correct fence management; see details
* add input validation to fix fields, i.e., select agent, and dynamic
  fields, i.e., fence parameters (according to param type)
* connect add, update, delete dialogs to respective back-end endpoints
2023-07-03 04:46:07 -04:00

41 lines
992 B
TypeScript

import { ReactElement, useMemo } from 'react';
import CommonFenceInputGroup from './CommonFenceInputGroup';
import Spinner from '../Spinner';
const EditFenceInputGroup = <M extends Record<string, string>>({
fenceId,
fenceTemplate: externalFenceTemplate,
formUtils,
loading: isExternalLoading,
previousFenceName,
previousFenceParameters,
}: EditFenceInputGroupProps<M>): ReactElement => {
const content = useMemo(
() =>
isExternalLoading ? (
<Spinner />
) : (
<CommonFenceInputGroup
fenceId={fenceId}
fenceTemplate={externalFenceTemplate}
formUtils={formUtils}
previousFenceName={previousFenceName}
previousFenceParameters={previousFenceParameters}
/>
),
[
externalFenceTemplate,
fenceId,
formUtils,
isExternalLoading,
previousFenceName,
previousFenceParameters,
],
);
return <>{content}</>;
};
export default EditFenceInputGroup;