import ActionsButtons from "components/ActionsButtons/ActionsButtons";
import { selectCart, setTmp } from "features/order/orderSlice";
import { useAppDispatch, useAppSelector } from "redux/hooks";

export default function PayForActions() {
  const dispatch = useAppDispatch();
  const { tmp } = useAppSelector(selectCart);

  return (
    <ActionsButtons
      quantity={tmp?.payFor || 1}
      setQuantity={(value) => dispatch(setTmp({ ...tmp, payFor: value }))}
      max={tmp?.totalPeople || 10}
      min={1}
    />
  );
}
