import { Spinner } from '@/internal/components/Spinner'; import { cn, pressable, text, prefixClassName } from '@/styles/theme'; import { TransactionButtonRenderParams } from '@/transaction/types'; export type RenderWithdrawButtonProps = TransactionButtonRenderParams & { withdrawAmountError: string | null; withdrawnAmount: string; vaultToken?: { symbol: string }; }; export function RenderWithdrawButton({ context, onSubmit, onSuccess, isDisabled, withdrawAmountError, withdrawnAmount, vaultToken, }: RenderWithdrawButtonProps) { const classNames = prefixClassName( cn( pressable.primary, 'rounded-ock-default', 'w-full rounded-xl', 'px-4 py-3 font-medium leading-6', isDisabled && pressable.disabled, text.headline, 'text-ock-foreground-inverse', ), ); if (context.receipt) { return ( ); } if (context.errorMessage || withdrawAmountError) { return ( ); } if (context.isLoading) { return ( ); } return ( ); }