index.tsx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { memo } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useResponsive } from '@/hooks/useResponsive';
  4. import PlanCard from '../PlanCard';
  5. import OrderSummary from '../OrderSummary';
  6. import { useAction } from './useAction';
  7. import { useService } from './useService';
  8. const PricingContent = memo(() => {
  9. const { t } = useTranslation();
  10. const { isMobile } = useResponsive();
  11. const { selectedPlanId, handlePlanClick } = useAction();
  12. const { plans } = useService();
  13. const selectedPlan = plans.find((plan) => plan.id === selectedPlanId) || null;
  14. return (
  15. <div className="max-w-[1440px] w-full px-[30px]">
  16. <div className="bg-[#0F1116] px-5 sm:px-6 lg:px-[100px] py-[30px] pb-[100px] my-[50px] rounded-[12px] flex flex-col gap-10">
  17. <div className="flex flex-col gap-5">
  18. <h1 className="text-white text-[35px] font-semibold leading-[1.43] text-center uppercase">
  19. {t('pages.pricing.title')}
  20. </h1>
  21. </div>
  22. <div className="flex flex-col gap-10">
  23. <div className="flex flex-col gap-2.5">
  24. <div className="flex gap-2.5">
  25. <span className="text-[#0EA5E9] text-[22px] font-semibold leading-[1.4]">
  26. {t('pages.pricing.step3')}
  27. </span>
  28. <span className="text-white text-[22px] font-semibold leading-[1.4] uppercase">
  29. {t('pages.pricing.step3Title')}
  30. </span>
  31. </div>
  32. <p className="text-[#646776] text-sm font-medium leading-[1.4]">
  33. {t('pages.pricing.description')}
  34. </p>
  35. <p className="text-[#646776] text-sm font-medium leading-[1.4]">
  36. {t('pages.pricing.currencyNote')}
  37. </p>
  38. </div>
  39. <div
  40. className={`flex ${
  41. isMobile
  42. ? 'flex-col items-center'
  43. : 'flex-row items-center justify-center'
  44. } gap-8`}
  45. >
  46. {plans.map((plan) => (
  47. <PlanCard
  48. key={plan.id}
  49. id={plan.id}
  50. title={plan.title}
  51. subTitle={plan.subTitle}
  52. introduce={plan.introduce}
  53. tag={plan.tag}
  54. tagType={plan.tagType}
  55. isSelected={selectedPlanId === plan.id}
  56. onClick={() => handlePlanClick(plan.id)}
  57. />
  58. ))}
  59. </div>
  60. </div>
  61. <OrderSummary selectedPlan={selectedPlan} />
  62. </div>
  63. </div>
  64. );
  65. });
  66. PricingContent.displayName = 'PricingContent';
  67. export default PricingContent;