2020-04-04 05:39:53 +00:00
|
|
|
import React from 'react';
|
|
|
|
import Spinner from '@/components/elements/Spinner';
|
2020-07-04 22:19:46 +00:00
|
|
|
import Fade from '@/components/elements/Fade';
|
|
|
|
import tw from 'twin.macro';
|
2020-04-04 05:39:53 +00:00
|
|
|
|
|
|
|
const InputSpinner = ({ visible, children }: { visible: boolean, children: React.ReactNode }) => (
|
2020-07-04 22:19:46 +00:00
|
|
|
<div css={tw`relative`}>
|
2020-10-16 04:21:38 +00:00
|
|
|
<Fade appear unmountOnExit in={visible} timeout={150}>
|
2020-07-04 22:19:46 +00:00
|
|
|
<div css={tw`absolute right-0 h-full flex items-center justify-end pr-3`}>
|
2020-07-04 19:39:55 +00:00
|
|
|
<Spinner size={'small'}/>
|
2020-04-04 05:39:53 +00:00
|
|
|
</div>
|
2020-07-04 22:19:46 +00:00
|
|
|
</Fade>
|
2020-04-04 05:39:53 +00:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default InputSpinner;
|