import { type PolicyTypes } from 'src/types/vacations';

import SellingBalanceBrazil from './SellingBalanceBrazil';
import SellingBalanceColombia from './SellingBalanceColombia';

type Props = {
  amountInTime: number;
  policyType: PolicyTypes | undefined;
};

const SellingBalanceRouter = ({ amountInTime, policyType }: Props) => {
  if (policyType?.allowBalanceSaleBrazil) {
    return (
      <SellingBalanceBrazil
        amountInTime={amountInTime}
        policyType={policyType}
      />
    );
  }

  if (policyType?.allowBalanceSale) {
    return (
      <SellingBalanceColombia
        amountInTime={amountInTime}
        policyType={policyType}
      />
    );
  }

  return null;
};

export default SellingBalanceRouter;
