import React from "react";
import { UpOutlined, DownOutlined } from "@ant-design/icons";

export default function FormListMoveArrows({ move, index, total }) {
  const upDisabled = index === 0;
  const downDisabled = index === total - 1;

  const handleUp = () => {
    move(index, index - 1);
  };

  const handleDown = () => {
    move(index, index - 1);
  };

  return (
    <div>
      <UpOutlined disabled={upDisabled} onClick={handleUp} />
      <DownOutlined disabled={downDisabled} onClick={handleDown} />
    </div>
  );
}
