Footer.tsx 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. import React, { useEffect, useState } from "react";
  2. import logo from "../assets/img/getgo.svg";
  3. import { useTranslation } from "react-i18next";
  4. import { getWithExpiry } from "../logic/loigicUtils";
  5. import { Area } from "../services/product/type";
  6. import { useNavigate } from "react-router-dom";
  7. import { DataCacheKey, staleTime } from "../global/constants";
  8. import { startLoading, stopLoading } from "../features/loading/loadingSlice";
  9. import { useAppDispatch } from "../hooks/useRedux";
  10. import { useQuery } from "@tanstack/react-query";
  11. import { productApi } from "../apis/productApi";
  12. const Footer: React.FC = () => {
  13. const { t } = useTranslation();
  14. const navigate = useNavigate();
  15. const dispatch = useAppDispatch();
  16. const { data: loadArea = [] } = useQuery<Area[]>({
  17. queryKey: [DataCacheKey.AREAS_FOOTER],
  18. queryFn: async (): Promise<Area[]> => {
  19. try {
  20. dispatch(startLoading({}));
  21. const res = await productApi.loadArea({
  22. isCountry: "1",
  23. isPopular: "1",
  24. });
  25. // save to redux store
  26. console.log("Get area response data:", res);
  27. return res.data as Area[];
  28. } catch (error) {
  29. console.error(error);
  30. return []; // 🔴 bắt buộc
  31. } finally {
  32. dispatch(stopLoading());
  33. }
  34. },
  35. staleTime: staleTime,
  36. });
  37. const popularAreas = React.useMemo(() => loadArea.slice(0, 3), [loadArea]);
  38. return (
  39. <footer className="bg-white border-t border-slate-100 pt-16 pb-8">
  40. <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  41. {/* Info Columns */}
  42. <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-12 mb-16">
  43. <div className="space-y-6">
  44. <div className="flex items-center space-x-2">
  45. {/* <svg
  46. className="w-8 h-8 text-[#EE0434]"
  47. viewBox="0 0 24 24"
  48. fill="currentColor"
  49. >
  50. <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" />
  51. </svg> */}
  52. <img
  53. src={logo}
  54. alt="SkySimHub Logo"
  55. className="text-[#EE0434] mr-0"
  56. style={{ width: "150px" }}
  57. />
  58. {/* <span className="text-xl font-black text-[#EE0434]">etgo</span> */}
  59. </div>
  60. <p className="text-sm font-bold text-[#EE0434] leading-tight">
  61. Công ty TNHH Phát triển toàn cầu VIETTECH
  62. </p>
  63. <p className="text-sm font-medium text-slate-600">
  64. Mã số thuế: 0901210362
  65. </p>
  66. <p className="text-sm font-medium text-slate-600">
  67. Ngày cấp: 09/01/2026
  68. </p>
  69. <p className="text-sm font-medium text-slate-600">
  70. Nơi cấp: Phòng Đăng Ký Kinh Doanh Tỉnh Hưng Yên - Sở Tài Chính
  71. Tỉnh Hưng Yên
  72. </p>
  73. <div className="space-y-3 text-sm text-slate-500">
  74. <p className="flex items-start">
  75. <svg
  76. className="w-4 h-4 mr-2 mt-0.5 text-[#EE0434]"
  77. fill="none"
  78. stroke="currentColor"
  79. viewBox="0 0 24 24"
  80. >
  81. <path
  82. strokeLinecap="round"
  83. strokeLinejoin="round"
  84. strokeWidth={2}
  85. d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
  86. />
  87. <path
  88. strokeLinecap="round"
  89. strokeLinejoin="round"
  90. strokeWidth={2}
  91. d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"
  92. />
  93. </svg>{" "}
  94. 218 Đảo Dừa 1, Khu đô thị Vinhomes Oceanpark 2, Xã Nghĩa Trụ,
  95. Tỉnh Hưng Yên, Việt Nam
  96. </p>
  97. <p className="flex items-center">
  98. <svg
  99. className="w-4 h-4 mr-2 text-[#EE0434]"
  100. fill="none"
  101. stroke="currentColor"
  102. viewBox="0 0 24 24"
  103. >
  104. <path
  105. strokeLinecap="round"
  106. strokeLinejoin="round"
  107. strokeWidth={2}
  108. d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
  109. />
  110. </svg>{" "}
  111. klinhnguyen@viettech.asia
  112. </p>
  113. <p className="flex items-center">
  114. <svg
  115. className="w-4 h-4 mr-2 text-[#EE0434]"
  116. fill="none"
  117. stroke="currentColor"
  118. viewBox="0 0 24 24"
  119. >
  120. <path
  121. strokeLinecap="round"
  122. strokeLinejoin="round"
  123. strokeWidth={2}
  124. d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
  125. />
  126. </svg>{" "}
  127. Zalo/Whatsapp: +84336548007
  128. </p>
  129. </div>
  130. </div>
  131. <div>
  132. <h3 className="text-base font-bold text-slate-900 mb-6">
  133. SkySimHub
  134. </h3>
  135. <ul className="space-y-4 text-sm text-slate-500">
  136. <li>
  137. <a href="#" className="hover:text-[#EE0434] transition-colors">
  138. {t("aboutUs")}
  139. </a>
  140. </li>
  141. <li>
  142. <a
  143. href="#"
  144. className="hover:text-[#EE0434] transition-colors"
  145. onClick={() => navigate("/terms")}
  146. >
  147. {t("termsService")}
  148. </a>
  149. </li>
  150. {/* <li>
  151. <a href="#" className="hover:text-[#EE0434] transition-colors">
  152. {t("privacyPolicy")}
  153. </a>
  154. </li> */}
  155. </ul>
  156. </div>
  157. <div>
  158. <h3 className="text-base font-bold text-slate-900 mb-6">
  159. Travel {t("sim")}
  160. </h3>
  161. <ul className="space-y-4 text-sm text-slate-500">
  162. {popularAreas.map((area) => (
  163. <li>
  164. <a
  165. href="#"
  166. className="hover:text-[#EE0434] transition-colors"
  167. onClick={() =>
  168. navigate(`/product-detail/${area.id}`, {
  169. state: {
  170. ...area,
  171. },
  172. })
  173. }
  174. >
  175. {area.areaName1}
  176. </a>
  177. </li>
  178. ))}
  179. {/* <li>
  180. <a
  181. href="#"
  182. className="hover:text-[#EE0434] transition-colors"
  183. onClick={() => navigate("/buy-sim")}
  184. >
  185. {t("chinaSim")}
  186. </a>
  187. </li>
  188. <li>
  189. <a
  190. href="#"
  191. className="hover:text-[#EE0434] transition-colors"
  192. onClick={() => navigate("/buy-sim")}
  193. >
  194. {t("thailandSim")}
  195. </a>
  196. </li>
  197. <li>
  198. <a
  199. href="#"
  200. className="hover:text-[#EE0434] transition-colors"
  201. onClick={() => navigate("/buy-sim")}
  202. >
  203. {t("japanSim")}
  204. </a>
  205. </li> */}
  206. </ul>
  207. </div>
  208. {/* <div>
  209. <h3 className="text-base font-bold text-slate-900 mb-6">Guide</h3>
  210. <ul className="space-y-4 text-sm text-slate-500">
  211. <li>
  212. <a href="#" className="hover:text-[#EE0434] transition-colors">
  213. {t("whatEsim")}
  214. </a>
  215. </li>
  216. <li>
  217. <a href="#" className="hover:text-[#EE0434] transition-colors">
  218. {t("supportSupport")}
  219. </a>
  220. </li>
  221. </ul>
  222. </div> */}
  223. </div>
  224. {/* Bottom */}
  225. <div className="pt-8 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0">
  226. <p className="text-sm text-slate-400">
  227. © 2025 SkySimHub All rights reserved
  228. </p>
  229. <div className="bg-[#EE0434] px-4 py-2 rounded-lg flex items-center space-x-2">
  230. <div className="w-5 h-5 bg-white rounded-full flex items-center justify-center text-[#EE0434]">
  231. <svg className="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
  232. <path
  233. fillRule="evenodd"
  234. d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
  235. clipRule="evenodd"
  236. />
  237. </svg>
  238. </div>
  239. <span className="text-[10px] text-white font-bold uppercase tracking-widest">
  240. Official Store Verified
  241. </span>
  242. </div>
  243. </div>
  244. </div>
  245. </footer>
  246. );
  247. };
  248. export default Footer;