interface ToggleAddressButtonProps {
  rowKey: string;
  setButtonDisabled: (value: boolean) => void;
  setAddress: (value: string) => void;
  setCurrentlyToggled: (value: string) => void;
  toggleClassName: string;
  address: string;
}

export default function ToggleAddressButton({
  rowKey,
  setButtonDisabled,
  setAddress,
  setCurrentlyToggled,
  toggleClassName,
  address,
}: ToggleAddressButtonProps) {
  const handleOnClick = () => {
    setCurrentlyToggled(rowKey);
    setAddress(address);
    setButtonDisabled(false);
  };

  return (
    <li key={rowKey}>
      <a onClick={handleOnClick} className={toggleClassName}>
        {address}
      </a>
    </li>
  );
}
