feat(striker-ui): add EditUpsInputGroup

main
Tsu-ba-me 2 years ago committed by digimer
parent 8fa4d3441e
commit 4aa42e680d
  1. 27
      striker-ui/components/ManageUps/EditUpsInputGroup.tsx
  2. 6
      striker-ui/types/EditUpsInputGroup.d.ts

@ -0,0 +1,27 @@
import { FC, ReactElement, useMemo } from 'react';
import CommonUpsInputGroup from './CommonUpsInputGroup';
import Spinner from '../Spinner';
const EditUpsInputGroup: FC<EditUpsInputGroupProps> = ({
loading: isExternalLoading,
previous,
upsUUID,
}) => {
const content = useMemo<ReactElement>(
() =>
isExternalLoading ? (
<Spinner />
) : (
<>
<CommonUpsInputGroup previous={previous} />
<input hidden id="edit-ups-input-ups-uuid" readOnly value={upsUUID} />
</>
),
[isExternalLoading, previous, upsUUID],
);
return content;
};
export default EditUpsInputGroup;

@ -0,0 +1,6 @@
type EditUpsInputGroupOptionalProps = {
loading?: boolean;
};
type EditUpsInputGroupProps = EditUpsInputGroupOptionalProps &
Pick<CommonUpsInputGroupProps, 'previous'> & { upsUUID: string };
Loading…
Cancel
Save