import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
import ProPhoneInput from "components/ProPhoneInput";
import { selectCart } from "features/order/orderSlice";
import { OrderType } from "pages/checkout/hooks/types.ts";
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";

export default function PhoneCard() {
  const { t } = useTranslation();
  const { orderType } = useAppSelector(selectCart);

  return (
    orderType !== OrderType.Gift && (
      <>
        <ProInputCard title={t("checkout.phoneNumber")}>
          <ProPhoneInput label={t("login.phone")} propName="phone" />
        </ProInputCard>
      </>
    )
  );
}
