diff --git a/app/soapbox/components/authorize-reject-buttons.tsx b/app/soapbox/components/authorize-reject-buttons.tsx index 81d25a63d..d4d90732e 100644 --- a/app/soapbox/components/authorize-reject-buttons.tsx +++ b/app/soapbox/components/authorize-reject-buttons.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import React, { useEffect, useRef, useState } from 'react'; import { FormattedMessage } from 'react-intl'; @@ -10,7 +11,7 @@ interface IAuthorizeRejectButtons { } /** Buttons to approve or reject a pending item, usually an account. */ -const AuthorizeRejectButtons: React.FC = ({ onAuthorize, onReject, countdown = 0 }) => { +const AuthorizeRejectButtons: React.FC = ({ onAuthorize, onReject, countdown }) => { const [state, setState] = useState<'authorizing' | 'rejecting' | 'authorized' | 'rejected' | 'pending'>('pending'); const timeout = useRef(); @@ -68,35 +69,60 @@ const AuthorizeRejectButtons: React.FC = ({ onAuthorize default: return ( -
- - {(state === 'rejecting') && ( -
- )} -
-
- - {(state === 'authorizing') && ( -
- )} -
+ + ); } }; +interface IAuthorizeRejectButton { + theme: 'primary' | 'danger' + icon: string + action(): void + isLoading?: boolean + disabled?: boolean +} + +const AuthorizeRejectButton: React.FC = ({ theme, icon, action, isLoading, disabled }) => { + return ( +
+ + {(isLoading) && ( +
+ )} +
+ ); +}; + export { AuthorizeRejectButtons }; \ No newline at end of file