Browse Source

类型导入优化

fogwind 4 days ago
parent
commit
2f0d2f1164
100 changed files with 130 additions and 130 deletions
  1. 1 1
      src/actions/addProductToCartAction.ts
  2. 1 1
      src/actions/deleteCartProductAction.ts
  3. 1 1
      src/actions/logoutAction.ts
  4. 1 1
      src/actions/mergeCartAction.ts
  5. 1 1
      src/app/(checkout)/checkout/_components/CheckoutAddress/AddressResultDisplay.tsx
  6. 1 1
      src/app/(checkout)/checkout/_components/CheckoutAddress/BillingAddressCheckout.tsx
  7. 4 4
      src/app/(checkout)/checkout/_components/CheckoutAddress/CheckoutAssress.tsx
  8. 1 1
      src/app/(checkout)/checkout/_components/CheckoutAddress/ShippingAddressCheckout.tsx
  9. 1 1
      src/app/(checkout)/checkout/_components/CheckoutCoupon/CheckoutCoupon.tsx
  10. 2 2
      src/app/(checkout)/checkout/_components/CheckoutPlaceOrder.tsx
  11. 1 1
      src/app/(checkout)/checkout/_components/CheckoutProducts/CheckoutProducts.tsx
  12. 5 5
      src/app/(checkout)/checkout/_components/CheckoutWrapper.tsx
  13. 1 1
      src/app/(checkout)/checkout/_components/ContinueToPay/ContinueToPayOrderInfo.tsx
  14. 3 3
      src/app/(checkout)/checkout/_components/ContinueToPay/PaymentMethodContinueTpPay.tsx
  15. 1 1
      src/app/(checkout)/checkout/_components/ContinueToPay/ProductsModalPendingOrder.tsx
  16. 2 2
      src/app/(checkout)/checkout/_components/GiftCard/CheckoutGiftCardGate.tsx
  17. 1 1
      src/app/(checkout)/checkout/_components/LostInsurance/LostInsurance.tsx
  18. 2 2
      src/app/(checkout)/checkout/_components/PaymentButton/PaypalApplepayButton.tsx
  19. 2 2
      src/app/(checkout)/checkout/_components/PaymentMethodCheckout.tsx
  20. 1 1
      src/app/(checkout)/checkout/_components/PromotionsDetails.tsx
  21. 1 1
      src/app/(checkout)/checkout/_components/RewardPointsRedeemMoney/RewardPointsRedeemMoney.tsx
  22. 2 2
      src/app/(checkout)/checkout/_components/ShippingMethodCheckout.tsx
  23. 1 1
      src/app/(checkout)/checkout/_components/VipPlus/CheckoutVipPlus.tsx
  24. 1 1
      src/app/(checkout)/checkout/cart/_components/CartWrapper.tsx
  25. 1 1
      src/app/(checkout)/checkout/cart/_components/UnpaidOrderSection.tsx
  26. 2 2
      src/app/(checkout)/checkout/cart/page.tsx
  27. 2 2
      src/app/(checkout)/checkout/continuetopay/page.tsx
  28. 1 1
      src/app/(checkout)/checkout/page.tsx
  29. 1 1
      src/app/(checkout)/layout.tsx
  30. 1 1
      src/app/(public)/[page]/page.tsx
  31. 1 1
      src/app/(public)/_components/CategoryTabSwiper .tsx
  32. 2 2
      src/app/(public)/_components/HomeBestSellers.tsx
  33. 1 1
      src/app/(public)/_components/HomeMiddleBanner.tsx
  34. 2 2
      src/app/(public)/_components/HomeNewArrival.tsx
  35. 1 1
      src/app/(public)/_components/JinGangSwiper.tsx
  36. 2 2
      src/app/(public)/_components/MiddleImageSwiper.tsx
  37. 2 2
      src/app/(public)/_components/RecommendedProducts.tsx
  38. 1 1
      src/app/(public)/_components/TopImageSwiper.tsx
  39. 2 2
      src/app/(public)/_components/Trending.tsx
  40. 1 1
      src/app/(public)/category/[slug]/[id]/_components/CategoryDesc.tsx
  41. 4 4
      src/app/(public)/category/[slug]/[id]/page.tsx
  42. 1 1
      src/app/(public)/customer/account/edit/page.tsx
  43. 1 1
      src/app/(public)/customer/account/mypoints/_components/GetPoints.tsx
  44. 1 1
      src/app/(public)/customer/account/mypoints/_components/PointsRule.tsx
  45. 1 1
      src/app/(public)/customer/account/pointlist/page.tsx
  46. 1 1
      src/app/(public)/customer/account/pointsreceivelist/page.tsx
  47. 1 1
      src/app/(public)/customer/address/page.tsx
  48. 1 1
      src/app/(public)/customer/forget-password/_components/ForgetPasswordForm.tsx
  49. 1 1
      src/app/(public)/customer/login/_components/LoginPageWrapper.tsx
  50. 1 1
      src/app/(public)/customer/reset-password/_components/ResetPasswordWrapper.tsx
  51. 1 1
      src/app/(public)/layout.tsx
  52. 1 1
      src/app/(public)/page.tsx
  53. 2 2
      src/app/(public)/paymentresult/_components/CancelOrFailure.tsx
  54. 2 2
      src/app/(public)/paymentresult/_components/OrderDetailWrapper.tsx
  55. 1 1
      src/app/(public)/paymentresult/result/page.tsx
  56. 1 1
      src/app/(public)/product/[...urlProduct]/page.tsx
  57. 1 1
      src/app/(public)/product/_components/ProductInformation.tsx
  58. 1 1
      src/app/(public)/product/_components/ProductMedia.tsx
  59. 1 1
      src/app/(public)/product/_components/SwitchButton.tsx
  60. 1 1
      src/app/(public)/product/_components/question/ComponentsQuestionModal.tsx
  61. 1 1
      src/app/(public)/product/_components/review/AddProductReview.tsx
  62. 1 1
      src/app/(public)/product/_components/review/AddRatingStar.tsx
  63. 2 2
      src/app/(public)/product/_components/review/QuestionInputModal.tsx
  64. 2 2
      src/app/(public)/product/_components/review/ReviewDetail.tsx
  65. 1 1
      src/app/(public)/product/_components/review/ReviewImageGalleryModal.tsx
  66. 1 1
      src/app/(public)/product/_components/review/ReviewImageUploader.tsx
  67. 1 1
      src/app/(public)/product/_components/review/ReviewModal.tsx
  68. 1 1
      src/app/(public)/product/_components/youmaylike/Recommend.tsx
  69. 1 1
      src/app/(public)/search/page.tsx
  70. 1 1
      src/app/api/customer/check-email/route.ts
  71. 1 1
      src/app/api/customer/orders/[id]/route.ts
  72. 1 1
      src/app/api/customer/orders/route.ts
  73. 1 1
      src/app/api/customer/orders/tracking/route.ts
  74. 1 1
      src/app/api/customer/reward-points/browse-product/route.ts
  75. 1 1
      src/app/api/customer/reward-points/follow/route.ts
  76. 1 1
      src/app/api/customer/reward-points/history/route.ts
  77. 1 1
      src/app/api/customer/token/address/route.ts
  78. 1 1
      src/app/api/gift/add/route.ts
  79. 1 1
      src/app/api/gift/my-gift-cards/route.ts
  80. 1 1
      src/app/api/revalidate/route.ts
  81. 1 1
      src/app/api/robots.ts
  82. 1 1
      src/app/api/shop/products/[productId]/reviews/route.ts
  83. 1 1
      src/app/api/shop/reviews/[id]/like/route.ts
  84. 1 1
      src/app/api/shop/reviews/route.ts
  85. 3 3
      src/app/layout.tsx
  86. 1 1
      src/components/catalog/product/ProductCard.tsx
  87. 1 1
      src/components/catalog/product/ProductsSection.tsx
  88. 1 1
      src/components/catalog/product/RelatedProductsSection.tsx
  89. 1 1
      src/components/catalog/review/AddProductReview.tsx
  90. 1 1
      src/components/catalog/review/AddRatingStar.tsx
  91. 1 1
      src/components/common/AddToCartModal/AddToCartModal.tsx
  92. 1 1
      src/components/common/AddToCartModal/ImgSwiperInAddToCartModal.tsx
  93. 1 1
      src/components/common/AddToCartModal/OpenAddToCartModalButton.tsx
  94. 1 1
      src/components/common/AddToCartModal/ProductOptionsInAddToCartModal.tsx
  95. 1 1
      src/components/common/LoadingSpinner.tsx
  96. 2 2
      src/components/common/LoginModal/LoginModal.tsx
  97. 1 1
      src/components/common/NextImage.tsx
  98. 1 1
      src/components/common/Rating.tsx
  99. 1 1
      src/components/common/Shimmer.tsx
  100. 0 0
      src/components/common/icons/StarIcon.tsx

+ 1 - 1
src/actions/addProductToCartAction.ts

@@ -6,7 +6,7 @@ import { CREATE_ADD_PRODUCT_IN_CART } from "@/graphql";
 import { auth } from "@/utils/auth/auth-helper";
 import { serverGraphqlFetch } from "@utils/bagisto";
 import {createGuestCartToken,setGuestCookie} from "@/server-service/guestCartTokenService";
-import { AddToCartData,AddToCartVariables } from "@/types/cart/type";
+import type { AddToCartData,AddToCartVariables } from "@/types/cart/type";
 
 
 export async function addProductToCartAction(param:AddToCartVariables) {

+ 1 - 1
src/actions/deleteCartProductAction.ts

@@ -4,7 +4,7 @@
 import { REMOVE_CART_ITEM } from "@/graphql";
 import { serverGraphqlFetch } from "@utils/bagisto";
 import {deleteGuestCookie} from "@/server-service/guestCartTokenService";
-import { RemoveCartItemData } from "@/types/cart/type";
+import type { RemoveCartItemData } from "@/types/cart/type";
 
 
 export async function deleteCartProductAction(cartItemId:number) {

+ 1 - 1
src/actions/logoutAction.ts

@@ -4,7 +4,7 @@ import {cookies} from "next/headers";
 import { IS_GUEST } from "@/utils/constants";
 import { serverGraphqlFetch } from "@utils/bagisto";
 import {CUSTOMER_LOGOUT} from "@/graphql/customer/mutations";
-import { LogoutData } from "@/types/types";
+import type { LogoutData } from "@/types/types";
 
 export async function logoutAction() {
 

+ 1 - 1
src/actions/mergeCartAction.ts

@@ -5,7 +5,7 @@ import {cookies} from "next/headers";
 import { GUEST_CART_ID, GUEST_CART_TOKEN, IS_GUEST } from "@/utils/constants";
 import { serverGraphqlFetch } from "@utils/bagisto";
 import { CREATE_MERGE_CART } from "@/graphql";
-import { CreateMergeCartData } from "@/types/cart/type";
+import type { CreateMergeCartData } from "@/types/cart/type";
 
 export async function mergeCartAction(){
 

+ 1 - 1
src/app/(checkout)/checkout/_components/CheckoutAddress/AddressResultDisplay.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-import {CartAddress} from "@/types/cart/type";
+import type {CartAddress} from "@/types/cart/type";
 
 function isAddressAvailable(address: CartAddress | null): boolean {
     if(address && 

+ 1 - 1
src/app/(checkout)/checkout/_components/CheckoutAddress/BillingAddressCheckout.tsx

@@ -20,7 +20,7 @@ import {
     IS_VALID_FULL_PHONE 
 } from "@utils/constants";
 import { useConfig } from "@utils/hooks/useConfig";
-import { CustomerAddressItem } from "@/types/customer/type";
+import type { CustomerAddressItem } from "@/types/customer/type";
 import InputText from "@/components/theme/ui/InputText";
 import Select from "@/components/theme/ui/Select";
 import PhoneNumberInput from "@/components/theme/ui/PhoneNumberInput/PhoneNumberInput";

+ 4 - 4
src/app/(checkout)/checkout/_components/CheckoutAddress/CheckoutAssress.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-import {Ref, useState, useEffect, useCallback, useImperativeHandle, useMemo } from "react";
+import {type Ref, useState, useEffect, useCallback, useImperativeHandle, useMemo } from "react";
 import { useRouter } from 'next/navigation';
 import { useForm, FormProvider } from "react-hook-form";
 import { useCustomToast } from "@/utils/hooks/useToast";
@@ -8,13 +8,13 @@ import {useCheckoutAddress} from "@/utils/hooks/useCheckoutAddress"
 import {useLoginModal} from "@/providers/LoginModalProvider";
 import { useGetCustomerAddress } from "@utils/hooks/useGetCustomerAddress";
 import { EMAIL_REGEX } from "@utils/constants";
-import { 
+import type { 
     ShipAddressFormData,
     FullAddressFormData,
     CreateCheckoutAddressVariables,
 } from "@/types/checkout/type";
-import { CustomerAddressItem,CheckEmailRegisteredData } from "@/types/customer/type";
-import { CartDetail,CartAddress } from "@/types/cart/type";
+import type { CustomerAddressItem,CheckEmailRegisteredData } from "@/types/customer/type";
+import type { CartDetail,CartAddress } from "@/types/cart/type";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import {clientFetch} from "@/lib/restApiClient";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";

+ 1 - 1
src/app/(checkout)/checkout/_components/CheckoutAddress/ShippingAddressCheckout.tsx

@@ -14,7 +14,7 @@ import {
 } from "@/components/theme/ui/PhoneNumberInput/phoneCodeMetaData";
 import { GET_COUNTRY_STATES } from "@/graphql";
 import { EMAIL_REGEX, IS_VALID_INPUT, IS_VALID_FULL_PHONE, IS_VALID_PHONECODE } from "@utils/constants";
-import { CustomerAddressItem } from "@/types/customer/type";
+import type { CustomerAddressItem } from "@/types/customer/type";
 import { useConfig } from "@utils/hooks/useConfig";
 import InputText from "@/components/theme/ui/InputText";
 import Select from "@/components/theme/ui/Select";

+ 1 - 1
src/app/(checkout)/checkout/_components/CheckoutCoupon/CheckoutCoupon.tsx

@@ -5,7 +5,7 @@ import {useSaveCheckoutCart} from "@/utils/hooks/useSaveCheckoutCart";
 import { useCustomToast } from "@/utils/hooks/useToast";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { formatCartDetail } from "@/utils/cartDetailTools";
-import {CartDetail} from "@/types/cart/type";
+import type {CartDetail} from "@/types/cart/type";
 
 
 

+ 2 - 2
src/app/(checkout)/checkout/_components/CheckoutPlaceOrder.tsx

@@ -2,10 +2,10 @@
 
 import clsx from 'clsx';
 import { useRouter } from 'next/navigation';
-import {AirwallexCartNumberElementType} from "@/lib/Airwallex/airwallexInit";
+import type {AirwallexCartNumberElementType} from "@/lib/Airwallex/airwallexInit";
 import PaypalButton from "./PaymentButton/PaypalButton";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
-import { PlaceOrderFunction,KlarnaOtherData } from "@/types/checkout/type";
+import type { PlaceOrderFunction,KlarnaOtherData } from "@/types/checkout/type";
 import { useCustomToast } from "@/utils/hooks/useToast";
 import { usePlaceOrder } from "@/utils/hooks/usePlaceOrder";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";

+ 1 - 1
src/app/(checkout)/checkout/_components/CheckoutProducts/CheckoutProducts.tsx

@@ -3,7 +3,7 @@
 import {useState} from "react";
 import { useRouter } from 'next/navigation';
 import Image from "next/image";
-import {CartDetail, CartItem} from "@/types/cart/type";
+import type {CartDetail, CartItem} from "@/types/cart/type";
 import { useAddProduct } from "@utils/hooks/useAddToCart";
 import { useCustomToast } from "@/utils/hooks/useToast";
 import {useConfig} from "@/utils/hooks/useConfig";

+ 5 - 5
src/app/(checkout)/checkout/_components/CheckoutWrapper.tsx

@@ -11,19 +11,19 @@ import {useSaveCheckoutCart} from "@/utils/hooks/useSaveCheckoutCart";
 import { usePlaceOrder } from "@/utils/hooks/usePlaceOrder";
 import {usePaymentSDKContext} from "@/providers/PaymentSDKProvider";
 import {airwallexManager} from "@/lib/Airwallex/useAirwallexCard";
-import { 
+import type { 
     PlaceOrderResult,
     PlaceOrderFunction,
     CreatePaymentInitiateVariables
 } from "@/types/checkout/type";
-import { CartDetail,CartAddress } from "@/types/cart/type";
+import type { CartDetail,CartAddress } from "@/types/cart/type";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
-import {ShippingMethodCheckout,RefShippingMethodsHandle} from "./ShippingMethodCheckout";
-import {PaymentMethodCheckout,RefPaymentMethodsHandle} from "./PaymentMethodCheckout";
+import {ShippingMethodCheckout, type RefShippingMethodsHandle} from "./ShippingMethodCheckout";
+import {PaymentMethodCheckout,type RefPaymentMethodsHandle} from "./PaymentMethodCheckout";
 import LoadingPaymentMethod from "./LoadingPaymentMethod";
-import {CheckoutAddress, RefCheckoutAddressHandle} from "./CheckoutAddress/CheckoutAssress";
+import {CheckoutAddress, type RefCheckoutAddressHandle} from "./CheckoutAddress/CheckoutAssress";
 import LoadingCheckoutPlaceOrder from "./LoadingCheckoutPlaceOrder";
 import CheckoutPlaceOrder from "./CheckoutPlaceOrder";
 import PaypalApplepayButton from "./PaymentButton/PaypalApplepayButton";

+ 1 - 1
src/app/(checkout)/checkout/_components/ContinueToPay/ContinueToPayOrderInfo.tsx

@@ -4,7 +4,7 @@ import { useState } from "react";
 import Image from "next/image";
 import { useRouter } from 'next/navigation';
 import {useConfig} from "@/utils/hooks/useConfig";
-import { OrderDetails } from "@/types/customer/type";
+import type { OrderDetails } from "@/types/customer/type";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
 import ProductsModalPendingOrder from "./ProductsModalPendingOrder";
 import dynamic from "next/dynamic";

+ 3 - 3
src/app/(checkout)/checkout/_components/ContinueToPay/PaymentMethodContinueTpPay.tsx

@@ -12,9 +12,9 @@ import {
     useAirwallexCardState
 } from "@/lib/Airwallex/useAirwallexCard";
 import {getPaymentMethodLogo,getPaymentDescription} from "@/utils/paymentTools";
-import {RepayOrderPaymentMethodsData} from "@/types/checkout/type";
-import { OrderDetails } from "@/types/customer/type";
-import {FetchGraphqlResult} from "@/types/graphqlFetch/type";
+import type {RepayOrderPaymentMethodsData} from "@/types/checkout/type";
+import type { OrderDetails } from "@/types/customer/type";
+import type {FetchGraphqlResult} from "@/types/graphqlFetch/type";
 import { usePlaceOrder } from "@/utils/hooks/usePlaceOrder";
 import PaypalButton from "../PaymentButton/PaypalButton";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";

+ 1 - 1
src/app/(checkout)/checkout/_components/ContinueToPay/ProductsModalPendingOrder.tsx

@@ -2,7 +2,7 @@
 
 import Image from "next/image";
 import CommonModal from "@/components/theme/ui/CommonModal";
-import {ProductsInOrderDetails, ProductItemAdditional} from "@/types/customer/type";
+import type {ProductsInOrderDetails, ProductItemAdditional} from "@/types/customer/type";
 
 
 // 根据products 计算总价和总个数

+ 2 - 2
src/app/(checkout)/checkout/_components/GiftCard/CheckoutGiftCardGate.tsx

@@ -2,13 +2,13 @@
 
 import {useState, useRef, useEffect, useCallback} from "react";
 import clsx from "clsx";
-import {CartDetail} from "@/types/cart/type";
+import type {CartDetail} from "@/types/cart/type";
 import {clientFetch} from "@/lib/restApiClient";
 import { useCustomToast } from "@/utils/hooks/useToast";
 import {useSaveCheckoutCart} from "@/utils/hooks/useSaveCheckoutCart";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
-import {GiftCardItem, GiftCardRespBody} from "@/types/api/gift/my-gift-cards";
+import type {GiftCardItem, GiftCardRespBody} from "@/types/api/gift/my-gift-cards";
 import CommonModal from "@/components/theme/ui/CommonModal";
 import { LoadingSpinner } from "@components/common/LoadingSpinner";
 

+ 1 - 1
src/app/(checkout)/checkout/_components/LostInsurance/LostInsurance.tsx

@@ -6,7 +6,7 @@ import { useCustomToast } from "@/utils/hooks/useToast";
 import {useSaveCheckoutCart} from "@/utils/hooks/useSaveCheckoutCart";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
-import {CartDetail} from "@/types/cart/type";
+import type {CartDetail} from "@/types/cart/type";
 
 /**
  * 先通过 shippingInsuranceEnabled 判断网站是否开通丢件险功能

+ 2 - 2
src/app/(checkout)/checkout/_components/PaymentButton/PaypalApplepayButton.tsx

@@ -14,9 +14,9 @@ import {
 } from "@paypal/react-paypal-js/sdk-v6";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
-import { CartAddress } from "@/types/cart/type";
+import type { CartAddress } from "@/types/cart/type";
 import { useConfig } from "@/utils/hooks/useConfig";
-import {ApplePayAddressContact} from "@/lib/Applepay/type";
+import type {ApplePayAddressContact} from "@/lib/Applepay/type";
 // import {getPaypalApplePayConfig, type PaypalApplePaySession} from "@/lib/Applepay/applepay";
 
 export default function PaypalApplepayButton({

+ 2 - 2
src/app/(checkout)/checkout/_components/PaymentMethodCheckout.tsx

@@ -1,11 +1,11 @@
 "use client";
 
 import Image from "next/image";
-import { Ref, useEffect, useImperativeHandle } from "react";
+import { type Ref, useEffect, useImperativeHandle } from "react";
 import { useForm, get } from "react-hook-form";
 import {useConfig} from "@/utils/hooks/useConfig";
 import {getPaymentMethodLogo,getPaymentDescription} from "@/utils/paymentTools";
-import { CheckoutPaymentMethod } from "@/types/checkout/type";
+import type { CheckoutPaymentMethod } from "@/types/checkout/type";
 import AirwallexCardInput from "./PaymentMethodAdditional/AirwallexCardInput";
 import {useAirwallexCardState} from "@/lib/Airwallex/useAirwallexCard";
 

+ 1 - 1
src/app/(checkout)/checkout/_components/PromotionsDetails.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-import { CartDetail } from "@/types/cart/type";
+import type { CartDetail } from "@/types/cart/type";
 
 
 // 金额明细

+ 1 - 1
src/app/(checkout)/checkout/_components/RewardPointsRedeemMoney/RewardPointsRedeemMoney.tsx

@@ -8,7 +8,7 @@ import {useLoginModal} from "@/providers/LoginModalProvider";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
-import {CartDetail} from "@/types/cart/type";
+import type {CartDetail} from "@/types/cart/type";
 
 // earnableRewardPoints 判断是否开启下单送积分
 

+ 2 - 2
src/app/(checkout)/checkout/_components/ShippingMethodCheckout.tsx

@@ -1,10 +1,10 @@
 "use client";
 
 import clsx from "clsx";
-import { useEffect, useImperativeHandle, Ref  } from "react";
+import { useEffect, useImperativeHandle, type Ref  } from "react";
 import { useForm, get } from "react-hook-form";
 
-import {CheckoutShippingRate} from "@/types/checkout/type";
+import type {CheckoutShippingRate} from "@/types/checkout/type";
 import CheckoutShippingMethodLoading from "./CheckoutShippingMethodLoading";
 
 

+ 1 - 1
src/app/(checkout)/checkout/_components/VipPlus/CheckoutVipPlus.tsx

@@ -2,7 +2,7 @@
 
 import {useState} from "react";
 import { useRouter } from 'next/navigation';
-import {CartDetail} from "@/types/cart/type";
+import type {CartDetail} from "@/types/cart/type";
 import { useCustomToast } from "@/utils/hooks/useToast";
 import {useSaveCheckoutCart} from "@/utils/hooks/useSaveCheckoutCart";
 import { formatCartDetail } from "@/utils/cartDetailTools";

+ 1 - 1
src/app/(checkout)/checkout/cart/_components/CartWrapper.tsx

@@ -11,7 +11,7 @@ import { useAddProduct } from "@utils/hooks/useAddToCart";
 import { updateCart, clearCart } from "@/store/slices/cart-slice";
 import {useConfig} from "@/utils/hooks/useConfig";
 import {useLoginModal} from "@/providers/LoginModalProvider";
-import { CartDetail, CartItem } from "@/types/cart/type";
+import type { CartDetail, CartItem } from "@/types/cart/type";
 import { formatCartDetail } from "@/utils/cartDetailTools";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";

+ 1 - 1
src/app/(checkout)/checkout/cart/_components/UnpaidOrderSection.tsx

@@ -9,7 +9,7 @@ import { useCustomToast } from "@/utils/hooks/useToast";
 import {useConfig} from "@/utils/hooks/useConfig";
 import { confirmDialog } from "@/components/theme/ui/kernel/confirm/api";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
-import { OrderDetails, ProductsInOrderDetails } from "@/types/customer/type";
+import type { OrderDetails, ProductsInOrderDetails } from "@/types/customer/type";
 import CommonModal from "@/components/theme/ui/CommonModal";
 const CountDown = dynamic(() => import("@/components/common/CountDown"), {
   ssr: false,

+ 2 - 2
src/app/(checkout)/checkout/cart/page.tsx

@@ -2,8 +2,8 @@ import { createHash } from "crypto";
 import {serverGraphqlFetch} from "@utils/bagisto/index";
 import { GET_CART_ITEM, GET_CUSTOMER_ORDERS } from "@/graphql";
 import { auth } from "@/utils/auth/auth-helper";
-import { GetCartItemData } from "@/types/cart/type";
-import { OrderListData, OrderListDataVariables, OrderDetails } from "@/types/customer/type";
+import type { GetCartItemData } from "@/types/cart/type";
+import type { OrderListData, OrderListDataVariables, OrderDetails } from "@/types/customer/type";
 import TitleHeader from "@components/layout/navbar/TitleHeader";
 import { EmptyCart } from "./_components/EmptyCart";
 import { PromiseInCart } from "./_components/PromiseInCart";

+ 2 - 2
src/app/(checkout)/checkout/continuetopay/page.tsx

@@ -6,8 +6,8 @@ import {serverGraphqlFetch} from "@utils/bagisto/index";
 import ContinueToPayOrderInfo from "../_components/ContinueToPay/ContinueToPayOrderInfo";
 import { GET_ORDER_DETAILS, GET_REPAYORDER_PAYMENT_METHODS } from "@/graphql";
 // import { Country } from "@/types/checkout/type";
-import { OrderDetailsData } from "@/types/customer/type";
-import { RepayOrderPaymentMethodsData } from "@/types/checkout/type";
+import type { OrderDetailsData } from "@/types/customer/type";
+import type { RepayOrderPaymentMethodsData } from "@/types/checkout/type";
 import {PaymentMethodContinueTpPay} from "../_components/ContinueToPay/PaymentMethodContinueTpPay";
 import LoadingPaymentMethod from "../_components/LoadingPaymentMethod";
 import TitleHeader from "@components/layout/navbar/TitleHeader";

+ 1 - 1
src/app/(checkout)/checkout/page.tsx

@@ -4,7 +4,7 @@ import {serverGraphqlFetch} from "@utils/bagisto/index";
 import CheckoutWrapper from "./_components/CheckoutWrapper";
 import { GET_CART_ITEM } from "@/graphql";
 import { auth } from "@/utils/auth/auth-helper";
-import { GetCartItemData } from "@/types/cart/type";
+import type { GetCartItemData } from "@/types/cart/type";
 import TitleHeader from "@components/layout/navbar/TitleHeader";
 
 /**

+ 1 - 1
src/app/(checkout)/layout.tsx

@@ -1,5 +1,5 @@
 
-import { ReactNode } from "react";
+import { type ReactNode } from "react";
 export default async function CheckoutLayout({
   children,
 }: {

+ 1 - 1
src/app/(public)/[page]/page.tsx

@@ -1,7 +1,7 @@
 import { notFound } from "next/navigation";
 import Prose from "@components/theme/search/Prose";
 import { getPage } from "@utils/bagisto";
-import { PageData } from "@/types/theme/theme-customization";
+import type { PageData } from "@/types/theme/theme-customization";
 
 
 export default async function Page({

+ 1 - 1
src/app/(public)/_components/CategoryTabSwiper .tsx

@@ -1,5 +1,5 @@
 "use client";
-import React from "react";
+
 import Link from "next/link";
 import { Swiper, SwiperSlide } from "swiper/react";
 import { FreeMode } from "swiper/modules";

+ 2 - 2
src/app/(public)/_components/HomeBestSellers.tsx

@@ -1,11 +1,11 @@
-import React from "react";
+
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation, Pagination } from "swiper/modules";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";
 // 导入Swiper基础样式
 import "swiper/css";
 import "swiper/css/navigation";
-import { HomeProduct } from "@/types/home/type";
+import type { HomeProduct } from "@/types/home/type";
 import Link from "next/link";
 interface HomeBestSellersProps {
   bestSellers: HomeProduct[];

+ 1 - 1
src/app/(public)/_components/HomeMiddleBanner.tsx

@@ -5,7 +5,7 @@ import { Navigation } from "swiper/modules";
 import "swiper/css";
 import "swiper/css/navigation";
 import Image from "next/image";
-import { HomeSectionImage } from "@/types/home/type";
+import type { HomeSectionImage } from "@/types/home/type";
 interface middleBannerProps {
   middleBanner: HomeSectionImage[];
 }

+ 2 - 2
src/app/(public)/_components/HomeNewArrival.tsx

@@ -1,11 +1,11 @@
-import React from "react";
+
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation, Pagination } from "swiper/modules";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";
 // 导入Swiper基础样式
 import "swiper/css";
 import "swiper/css/navigation";
-import {HomeProduct} from "@/types/home/type"
+import type {HomeProduct} from "@/types/home/type"
 interface NewArrivalProps {
   newArrival: HomeProduct[];
 }

+ 1 - 1
src/app/(public)/_components/JinGangSwiper.tsx

@@ -6,7 +6,7 @@ import { Navigation } from "swiper/modules";
 import "swiper/css";
 import "swiper/css/navigation";
 import Image from "next/image";
-import { HomeSectionImage } from "@/types/home/type";
+import type { HomeSectionImage } from "@/types/home/type";
 interface jinGangProps {
   jinGang: HomeSectionImage[];
 }

+ 2 - 2
src/app/(public)/_components/MiddleImageSwiper.tsx

@@ -1,4 +1,4 @@
-import React from "react";
+
 import { Swiper, SwiperSlide } from "swiper/react";
 import {  Pagination  } from "swiper/modules";
 import "swiper/css";
@@ -6,7 +6,7 @@ import "swiper/css/pagination";
 import "swiper/css/navigation";
 import "./css/swiper-custom.css";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";
-import {HomeProduct,HomeSectionImage} from "@/types/home/type"
+import type {HomeProduct,HomeSectionImage} from "@/types/home/type"
 interface zeroWearProps {
   zeroWear: HomeProduct[];
   zeroWearImage:HomeSectionImage[]

+ 2 - 2
src/app/(public)/_components/RecommendedProducts.tsx

@@ -1,8 +1,8 @@
 "use client";
-import React, { useState, useEffect, useCallback } from "react";
+import { useState, useEffect, useCallback } from "react";
 import Image from "next/image";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";
-import {HomeProduct} from "@/types/home/type"
+import type {HomeProduct} from "@/types/home/type"
 interface recommendedProps {
   recommended: HomeProduct[];
 }

+ 1 - 1
src/app/(public)/_components/TopImageSwiper.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+
 import { Swiper, SwiperSlide } from 'swiper/react';
 import 'swiper/css';
 // import { Navigation, Pagination, Mousewheel, Keyboard } from 'swiper/modules';

+ 2 - 2
src/app/(public)/_components/Trending.tsx

@@ -1,4 +1,4 @@
-import React, { useState, useRef, useEffect } from "react";
+import { useState, useRef, useEffect } from "react";
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Scrollbar, Navigation } from "swiper/modules";
 import "swiper/css";
@@ -6,7 +6,7 @@ import "swiper/css/scrollbar";
 import "swiper/css/navigation";
 import Image from "next/image";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";
-import {HomeProduct} from "@/types/home/type"
+import type {HomeProduct} from "@/types/home/type"
 interface trendingProps {
   trending: HomeProduct[];
 }

+ 1 - 1
src/app/(public)/category/[slug]/[id]/_components/CategoryDesc.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-import { FC, useState, useEffect, useRef } from "react";
+import { type FC, useState, useEffect, useRef } from "react";
 
 interface CategoryDescProps {
   title: string;

+ 4 - 4
src/app/(public)/category/[slug]/[id]/page.tsx

@@ -1,10 +1,10 @@
-import { Metadata } from "next";
+import { type Metadata } from "next";
 import { notFound } from "next/navigation";
 // import { isArray } from "@/utils/type-guards";
 // import FilterList from "@components/theme/filters/FilterList";
 // import Pagination from "@components/catalog/Pagination";
 import ProductListing from "./_components/ProductListing";
-import { ProductsResponse } from "@components/catalog/type";
+import type { ProductsResponse } from "@components/catalog/type";
 import {
   GET_FILTER_PRODUCTS,
   // GET_TREE_CATEGORIES,
@@ -18,7 +18,7 @@ import {
 import { SortByFields } from "@utils/constants";
 // import { CategoryDetail } from "@components/theme/search/CategoryDetail";
 import CategoryDesc from "./_components/CategoryDesc";
-import FaqList, { FaqItem } from "./_components/FaqList";
+import FaqList, { type FaqItem } from "./_components/FaqList";
 import { Suspense } from "react";
 import FilterListSkeleton from "@components/common/skeleton/FilterSkeleton";
 // import { TreeCategoriesResponse } from "@/types/theme/category-tree";
@@ -29,7 +29,7 @@ import {
   buildProductFilters,
 } from "@utils/helper";
 import { serverGraphqlFetch } from "@/utils/bagisto/index";
-import {
+import type {
   // CategoryNode,
   CategorySingleResponse,
 } from "@/types/theme/category-tree";

+ 1 - 1
src/app/(public)/customer/account/edit/page.tsx

@@ -5,7 +5,7 @@ import { useEffect } from "react";
 import {
   parseDate,
   CalendarDate,
-  DateValue
+  type DateValue
 } from "@internationalized/date";
 import Link from "next/link";
 import { DatePicker } from "@heroui/date-picker";

+ 1 - 1
src/app/(public)/customer/account/mypoints/_components/GetPoints.tsx

@@ -1,6 +1,6 @@
 "use client";
 // import Link from "next/link";
-import React, { useState, useEffect } from "react";
+import { useState, useEffect } from "react";
 import { clientFetch } from "@/lib/restApiClient";
 
 export default function GetPoints() {

+ 1 - 1
src/app/(public)/customer/account/mypoints/_components/PointsRule.tsx

@@ -1,5 +1,5 @@
 "use client";
-import React, { useState } from "react";
+import { useState } from "react";
 import PointsRuleModal from "@/components/customer/PointsRule";
 export default function PointsRule() {
   // 控制弹窗显隐的状态

+ 1 - 1
src/app/(public)/customer/account/pointlist/page.tsx

@@ -1,5 +1,5 @@
 "use client";
-import React, { useState, useEffect, useRef, useCallback } from "react";
+import { useState, useEffect, useRef, useCallback } from "react";
 import Link from "next/link";
 import { clientFetch } from "@/lib/restApiClient";
 

+ 1 - 1
src/app/(public)/customer/account/pointsreceivelist/page.tsx

@@ -1,4 +1,4 @@
-import React from "react";
+
 import Link from "next/link";
 import RedeemGiftCard from "./_components/RedeemGiftCard"
 // 定义积分兑换项的类型

+ 1 - 1
src/app/(public)/customer/address/page.tsx

@@ -1,4 +1,4 @@
-import React from "react";
+
 import Link from "next/link";
 import  DefaultAddress from "./_components/DefaultAddress";
 const CustomerAddressPage = async () => {

+ 1 - 1
src/app/(public)/customer/forget-password/_components/ForgetPasswordForm.tsx

@@ -1,6 +1,6 @@
 "use client";
 import { useState } from "react";
-import { useForm, SubmitHandler } from "react-hook-form";
+import { useForm, type SubmitHandler } from "react-hook-form";
 import Link from "next/link";
 import {recoverPasswordAction} from "@/actions";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";

+ 1 - 1
src/app/(public)/customer/login/_components/LoginPageWrapper.tsx

@@ -15,7 +15,7 @@ import { useUserRegister } from "@/utils/hooks/useUserRegister";
 import { useCartDetail } from "@utils/hooks/useCartDetail";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { formatCartDetail } from "@/utils/cartDetailTools";
-import {LoginFormData, RegisterFormData} from "@/types/customer/type";
+import type {LoginFormData, RegisterFormData} from "@/types/customer/type";
 import InputText from "@/components/theme/ui/InputText";
 import PasswordInput from "@/components/theme/ui/PasswordInput";
 import PhoneNumberInput from "@/components/theme/ui/PhoneNumberInput/PhoneNumberInput";

+ 1 - 1
src/app/(public)/customer/reset-password/_components/ResetPasswordWrapper.tsx

@@ -1,6 +1,6 @@
 "use client";
 
-import { useForm, SubmitHandler } from "react-hook-form";
+import { useForm, type SubmitHandler } from "react-hook-form";
 import {RESET_PASSWORD} from "@/graphql";
 import { useRouter } from "next/navigation";
 import { useApolloClient } from "@apollo/client/react";

+ 1 - 1
src/app/(public)/layout.tsx

@@ -1,4 +1,4 @@
-import { ReactNode } from "react";
+import { type ReactNode } from "react";
 import Footer from "@/components/layout/footer";
 import Navbar from "@/components/layout/navbar";
 

+ 1 - 1
src/app/(public)/page.tsx

@@ -1,6 +1,6 @@
 import HomeContent from "./_components/HomeContent";
 import { restApiFetch } from "@utils/bagisto/index";
-import {HomeApiData} from "@/types/home/type"
+import type {HomeApiData} from "@/types/home/type"
 export const revalidate = 3600;
 
 

+ 2 - 2
src/app/(public)/paymentresult/_components/CancelOrFailure.tsx

@@ -2,8 +2,8 @@
 
 import {use, useEffect, useRef} from "react";
 import Link from "next/link";
-import {FetchGraphqlResult} from "@/types/graphqlFetch/type";
-import { OrderDetailsData } from "@/types/customer/type";
+import type {FetchGraphqlResult} from "@/types/graphqlFetch/type";
+import type { OrderDetailsData } from "@/types/customer/type";
 import { usePlaceOrder } from "@/utils/hooks/usePlaceOrder";
 import Faqs from "./Faqs";
 import { useAppDispatch } from "@/store/hooks";

+ 2 - 2
src/app/(public)/paymentresult/_components/OrderDetailWrapper.tsx

@@ -4,8 +4,8 @@ import {use, useEffect} from "react";
 import { redirect, RedirectType } from 'next/navigation';
 import Link from "next/link";
 import Image from "next/image";
-import {FetchGraphqlResult} from "@/types/graphqlFetch/type";
-import { OrderDetailsData,ProductItemAdditional } from "@/types/customer/type";
+import type {FetchGraphqlResult} from "@/types/graphqlFetch/type";
+import type { OrderDetailsData,ProductItemAdditional } from "@/types/customer/type";
 import {deleteGuestCookieAction} from "@/actions";
 import { useConfig } from "@utils/hooks/useConfig";
 import {getAddressFromOrderDetailAddressList} from "@/utils/orderDetailTools";

+ 1 - 1
src/app/(public)/paymentresult/result/page.tsx

@@ -4,7 +4,7 @@ import { redirect, RedirectType } from 'next/navigation'
 import { auth } from "@/utils/auth/auth-helper";
 import {serverGraphqlFetch} from "@utils/bagisto/index";
 import {GET_ORDER_DETAILS} from "@/graphql";
-import { OrderDetailsData } from "@/types/customer/type";
+import type { OrderDetailsData } from "@/types/customer/type";
 import SuccessPageSkeleton from "../_components/SuccessPageSkeleton";
 import SkeletonCancelOrFailure from "../_components/SkeletonCancelOrFailure";
 import CancelOrFailure from "../_components/CancelOrFailure";

+ 1 - 1
src/app/(public)/product/[...urlProduct]/page.tsx

@@ -7,7 +7,7 @@ import {
 import { BASE_SCHEMA_URL, PRODUCT_TYPE } from "@/utils/constants";
 import { GET_PRODUCT_BY_URL_KEY } from "@/graphql";
 import {serverGraphqlFetch} from "@utils/bagisto/index";
-import {
+import type {
   ProductOption,
   SingleProductResponse,
   ProductMediaType,

+ 1 - 1
src/app/(public)/product/_components/ProductInformation.tsx

@@ -2,7 +2,7 @@
 
 import { useState, useMemo } from "react";
 import clsx from "clsx";
-import { ProductOption, ResolvedVariant } from "@/components/catalog/type";
+import type { ProductOption, ResolvedVariant } from "@/components/catalog/type";
 import { ProductAddToCart } from "@/app/(public)/product/_components/ProductAddToCart";
 import { useCustomToast } from "@utils/hooks/useToast";
 import { useAddProduct } from "@utils/hooks/useAddToCart";

+ 1 - 1
src/app/(public)/product/_components/ProductMedia.tsx

@@ -7,7 +7,7 @@ import { Swiper, SwiperSlide } from "swiper/react";
 import { Pagination } from "swiper/modules";
 import type { Swiper as SwiperType } from "swiper";
 import type { PaginationOptions } from "swiper/types";
-import { ProductMediaType } from "@/components/catalog/type";
+import type { ProductMediaType } from "@/components/catalog/type";
 import { baseUrl, getImageUrl } from "@/utils/constants";
 import { useState, useRef } from "react";
 

+ 1 - 1
src/app/(public)/product/_components/SwitchButton.tsx

@@ -3,7 +3,7 @@ import { useState, useMemo, useEffect, useCallback } from "react";
 import ProductReviewSection  from "@/app/(public)/product/_components/ProductReviewSection";
 import Image from "next/image";
 import ReviewAdd from "@/app/(public)/product/_components/review/ReviewAdd";
-import FaqList, { FaqItem } from "./question/FaqList";
+import FaqList, { type FaqItem } from "./question/FaqList";
 import HairPhotoGallery from "./review/HairPhotoGallery";
 import { clientFetch } from "@/lib/restApiClient";
 import { getUuId } from "@/utils/helper";

+ 1 - 1
src/app/(public)/product/_components/question/ComponentsQuestionModal.tsx

@@ -1,6 +1,6 @@
 import { useState, useEffect } from "react";
 import { X } from "lucide-react";
-import { QaItem } from "./QAModal";
+import { type QaItem } from "./QAModal";
 // interface WigAnswer {
   // id: string;
   // answer: string;

+ 1 - 1
src/app/(public)/product/_components/review/AddProductReview.tsx

@@ -8,7 +8,7 @@ import { useCustomToast } from "@utils/hooks/useToast";
 import { useProductReview } from "@utils/hooks/useProductReview";
 import Image from "next/image";
 
-import { CreateProductReviewInput } from "@/types/review";
+import type { CreateProductReviewInput } from "@/types/review";
 import { AddUploadImage } from "@components/common/icons/AddUploadImage";
 
 interface UploadImgItem {

+ 1 - 1
src/app/(public)/product/_components/review/AddRatingStar.tsx

@@ -3,7 +3,7 @@
 import { useState, useEffect } from "react";
 import clsx from "clsx";
 import { StarIcon } from "@heroicons/react/24/solid";
-import { RatingTypes } from "@/components/catalog/type";
+import type { RatingTypes } from "@/components/catalog/type";
 
 
 export const AddRatingStar = ({

+ 2 - 2
src/app/(public)/product/_components/review/QuestionInputModal.tsx

@@ -1,5 +1,5 @@
 "use client";
-import { useState } from "react";
+import { useState, type SubmitEvent } from "react";
 import { Textarea } from "@heroui/input";
 import { Button } from "@components/common/button/Button";
 
@@ -18,7 +18,7 @@ export default function QuestionInputModal({
   const [errorMsg, setErrorMsg] = useState("");
 
   // 提交处理
-  const handleSubmit = async (e: React.FormEvent) => {
+  const handleSubmit = async (e: SubmitEvent) => {
     e.preventDefault();
     setErrorMsg("");
     const trimText = content.trim();

+ 2 - 2
src/app/(public)/product/_components/review/ReviewDetail.tsx

@@ -10,8 +10,8 @@ import {
 import { isArray } from "@/utils/type-guards";
 import { Avatar } from "@heroui/avatar";
 import clsx from "clsx";
-import React, { FC, useState } from "react";
-import { ProductReviewNode } from "@/components/catalog/type";
+import React, { type FC, useState } from "react";
+import type { ProductReviewNode } from "@/components/catalog/type";
 import ReviewModal from "./ReviewModal";
 // import { ReviewTabType } from "@/types/products/review";
 import { useCustomToast } from "@utils/hooks/useToast";

+ 1 - 1
src/app/(public)/product/_components/review/ReviewImageGalleryModal.tsx

@@ -3,7 +3,7 @@ import { useRef, useState } from "react";
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation } from "swiper/modules";
 import Image from "next/image";
-import { GalleryItem } from "@/types/products/review";
+import type { GalleryItem } from "@/types/products/review";
 import "swiper/css";
 import "swiper/css/navigation";
 

+ 1 - 1
src/app/(public)/product/_components/review/ReviewImageUploader.tsx

@@ -1,5 +1,5 @@
 "use client";
-// import { useState } from "react";
+import type React from "react";
 import Image from "next/image";
 import { AddUploadImage } from "@components/common/icons/AddUploadImage";
 import { useCustomToast } from "@utils/hooks/useToast";

+ 1 - 1
src/app/(public)/product/_components/review/ReviewModal.tsx

@@ -1,6 +1,6 @@
 "use client";
 import React, { useState, useRef, useEffect, useCallback } from "react";
-import {
+import type {
   ReviewTabType,
   ProductReviewList,
   GalleryItem,

+ 1 - 1
src/app/(public)/product/_components/youmaylike/Recommend.tsx

@@ -1,5 +1,5 @@
 "use client";
-import React from "react";
+
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation, Pagination } from "swiper/modules";
 import { OpenAddToCartModalButton } from "@/components/common/AddToCartModal/OpenAddToCartModalButton";

+ 1 - 1
src/app/(public)/search/page.tsx

@@ -12,7 +12,7 @@ import SortOrder from "@/components/theme/filters/SortOrder";
 import { SortByFields } from "@/utils/constants";
 // import MobileFilter from "@/components/theme/filters/MobileFilter";
 // import FilterList from "@/components/theme/filters/FilterList";
-import {
+import type {
   SearchProductsResponse,
   SearchProductsVariables,
 } from "@/components/catalog/type";

+ 1 - 1
src/app/api/customer/check-email/route.ts

@@ -1,4 +1,4 @@
-import { NextResponse, NextRequest } from "next/server";
+import { NextResponse, type NextRequest } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/orders/[id]/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/orders/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/orders/tracking/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/reward-points/browse-product/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/reward-points/follow/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/reward-points/history/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/customer/token/address/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 // import type { GiftListBody,FetchWrap  } from '@/types/api/gift/lists';

+ 1 - 1
src/app/api/gift/add/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 export async function POST(req: NextRequest) {

+ 1 - 1
src/app/api/gift/my-gift-cards/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 import type { GiftCardRespBody } from '@/types/api/gift/my-gift-cards';
 export async function GET(req: NextRequest) {

+ 1 - 1
src/app/api/revalidate/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { headers } from "next/headers";
 import { revalidatePath } from "next/cache";
 

+ 1 - 1
src/app/api/robots.ts

@@ -1,4 +1,4 @@
-import { NextApiRequest, NextApiResponse } from "next";
+import type { NextApiRequest, NextApiResponse } from "next";
 
 function generateRobotsTxt(host: string) {
   return `

+ 1 - 1
src/app/api/shop/products/[productId]/reviews/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 1 - 1
src/app/api/shop/reviews/[id]/like/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 type RouteParams = Promise<{ id: string }>;

+ 1 - 1
src/app/api/shop/reviews/route.ts

@@ -1,4 +1,4 @@
-import { NextRequest, NextResponse } from "next/server";
+import { type NextRequest, NextResponse } from "next/server";
 import { restApiFetch } from "@/utils/bagisto";
 
 

+ 3 - 3
src/app/layout.tsx

@@ -12,9 +12,9 @@ import clsx from "clsx";
 import {KernelProvider} from "@components/theme/ui/kernel/KernelProvider";
 import { GET_CART_ITEM,GET_COUNTRIES,GET_CURRENCIES } from "@/graphql";
 import {serverGraphqlFetch} from "@utils/bagisto/index";
-import { GetCartItemData } from "@/types/cart/type";
-import { Country } from "@/types/checkout/type";
-import { CurrenciesData } from "@/types/currency/type";
+import type { GetCartItemData } from "@/types/cart/type";
+import type { Country } from "@/types/checkout/type";
+import type { CurrenciesData } from "@/types/currency/type";
 import {CURRENT_CURRENCY,CURRENT_LOCAL,CURRENT_CHANNEL} from "@/utils/constants";
 import AuthSessionGuard from "@/components/customer/AuthSessionGuard";
 

+ 1 - 1
src/components/catalog/product/ProductCard.tsx

@@ -1,5 +1,5 @@
 import Link from "next/link";
-import { FC } from "react";
+import { type FC } from "react";
 import Grid from "@/components/theme/ui/grid/Grid";
 import { NextImage } from "@/components/common/NextImage";
 import { Price } from "@/components/theme/ui/Price";

+ 1 - 1
src/components/catalog/product/ProductsSection.tsx

@@ -3,7 +3,7 @@ import { NOT_IMAGE } from "@/utils/constants";
 import Grid from "../../theme/ui/grid/Grid";
 import { baseUrl, getImageUrl } from "@/utils/constants";
 import { ProductCard } from "./ProductCard";
-import { ProductsSectionProps } from "../type";
+import type { ProductsSectionProps } from "../type";
 
 
 export function ProductsSection({ title, description, products }: ProductsSectionProps) {

+ 1 - 1
src/components/catalog/product/RelatedProductsSection.tsx

@@ -1,6 +1,6 @@
 import { GET_RELATED_PRODUCTS } from "@/graphql";
 import { ProductsSection } from "./ProductsSection";
-import { SingleProductResponse } from "@components/catalog/type";
+import type { SingleProductResponse } from "@components/catalog/type";
 import {serverGraphqlFetch} from "@utils/bagisto/index";
 
 export async function RelatedProductsSection({

+ 1 - 1
src/components/catalog/review/AddProductReview.tsx

@@ -8,7 +8,7 @@ import { useCustomToast } from "@utils/hooks/useToast";
 import { useProductReview } from "@utils/hooks/useProductReview";
 import Image from "next/image";
 
-import { CreateProductReviewInput } from "@/types/review";
+import type { CreateProductReviewInput } from "@/types/review";
 import { AddUploadImage } from "@components/common/icons/AddUploadImage";
 
 export default function AddProductReview({

+ 1 - 1
src/components/catalog/review/AddRatingStar.tsx

@@ -3,7 +3,7 @@
 import { useState, useEffect } from "react";
 import clsx from "clsx";
 import { StarIcon } from "@heroicons/react/24/solid";
-import { RatingTypes } from "../type";
+import type { RatingTypes } from "../type";
 
 
 export const AddRatingStar = ({

+ 1 - 1
src/components/common/AddToCartModal/AddToCartModal.tsx

@@ -17,7 +17,7 @@ import {
   DrawerBody,
   DrawerFooter
 } from "@heroui/drawer";
-import { 
+import type { 
     ProductOption, 
     ResolvedVariant 
 } from "@/components/catalog/type";

+ 1 - 1
src/components/common/AddToCartModal/ImgSwiperInAddToCartModal.tsx

@@ -3,7 +3,7 @@ import { memo } from "react";
 import { Swiper, SwiperSlide } from 'swiper/react';
 import 'swiper/css';
 import Image from "next/image";
-import { ProductMediaType } from "@/components/catalog/type";
+import type { ProductMediaType } from "@/components/catalog/type";
 
 const ImgSwiperInAddToCartModal = memo(function ImgSwiperInAddToCartModal({images}: {images: ProductMediaType[];}) { 
     return (

+ 1 - 1
src/components/common/AddToCartModal/OpenAddToCartModalButton.tsx

@@ -1,5 +1,5 @@
 "use client";
-import { FC, ReactNode } from "react";
+import { type FC, type ReactNode } from "react";
 import { useAppDispatch } from "@/store/hooks";
 import { openAddToCartDialog } from "@/store/slices/addToCartDialogSlice";
 import { GET_PRODUCT_BY_ID } from "@/graphql";

+ 1 - 1
src/components/common/AddToCartModal/ProductOptionsInAddToCartModal.tsx

@@ -1,7 +1,7 @@
 "use client";
 
 import clsx from "clsx";
-import { 
+import type { 
     ProductOption, 
 } from "@/components/catalog/type";
 

+ 1 - 1
src/components/common/LoadingSpinner.tsx

@@ -1,4 +1,4 @@
-import { FC } from "react";
+import { type FC } from "react";
 
 interface LoadingSpinnerProps {
   colorClassName?: string;

+ 2 - 2
src/components/common/LoginModal/LoginModal.tsx

@@ -13,8 +13,8 @@ import { useCustomToast } from "@/utils/hooks/useToast";
 import { useUserRegister } from "@/utils/hooks/useUserRegister";
 import { overlayLoading } from "@/components/theme/ui/kernel/loading/api";
 import { formatCartDetail } from "@/utils/cartDetailTools";
-import {CartDetail} from "@/types/cart/type";
-import {LoginFormData, RegisterFormData} from "@/types/customer/type";
+import type {CartDetail} from "@/types/cart/type";
+import type {LoginFormData, RegisterFormData} from "@/types/customer/type";
 import CommonModal from "@/components/theme/ui/CommonModal";
 import InputText from "@/components/theme/ui/InputText";
 import PasswordInput from "@/components/theme/ui/PasswordInput";

+ 1 - 1
src/components/common/NextImage.tsx

@@ -3,7 +3,7 @@
 import { useState } from "react";
 import Image from "next/image";
 import { NOT_IMAGE } from "@/utils/constants";
-import { NextImageProps } from "./type";
+import type { NextImageProps } from "./type";
 import { Shimmer } from "./Shimmer";
 
 

+ 1 - 1
src/components/common/Rating.tsx

@@ -1,5 +1,5 @@
 import clsx from "clsx";
-import { RatingTypes } from "./type";
+import type { RatingTypes } from "./type";
 import StarIcon from "./icons/StarIcon";
 
 export const Rating = ({

+ 1 - 1
src/components/common/Shimmer.tsx

@@ -1,7 +1,7 @@
 // src/components/common/Shimmer.tsx
 "use client";
 
-import { HTMLAttributes } from "react";
+import { type HTMLAttributes } from "react";
 
 interface ShimmerProps extends HTMLAttributes<HTMLDivElement> {
   className?: string;

+ 0 - 0
src/components/common/icons/StarIcon.tsx


Some files were not shown because too many files changed in this diff