|
|
@ -1,25 +1,38 @@ |
|
|
|
// components/Subscription.tsx
|
|
|
|
import { useGetActiveSubscription } from '@/data/subscription'; |
|
|
|
import Image from 'next/image'; |
|
|
|
import React from 'react'; |
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
|
|
|
const Subscription: React.FC = () => { |
|
|
|
const { t } = useTranslation('common'); // Specify the namespace if using multiple
|
|
|
|
const { data: activeData, isLoading: isActiveLoading } = |
|
|
|
useGetActiveSubscription(); |
|
|
|
console.log(activeData); |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className="col-span-full rounded-lg bg-light p-6 md:p-7"> |
|
|
|
<div className="mb-5 flex items-center justify-between md:mb-7"> |
|
|
|
<h3 className="before:content-'' relative mt-1 bg-light text-lg font-semibold text-heading before:absolute before:-top-px before:h-7 before:w-1 before:rounded-tr-md before:rounded-br-md before:bg-accent ltr:before:-left-6 rtl:before:-right-6 md:before:-top-0.5 md:ltr:before:-left-7 md:rtl:before:-right-7 lg:before:h-8"> |
|
|
|
{/* {t('text-7day-subscription')} */} |
|
|
|
You have a 7-day free subscription. |
|
|
|
{activeData?.status === 'no_subscription' && ( |
|
|
|
<h3 className=" bg-red-100 w-full p-3 text-red-700 -mt-3 relative text-lg rounded-lg"> |
|
|
|
You dont have active subscription |
|
|
|
</h3> |
|
|
|
<div className='p-2 bg-green-50'> |
|
|
|
|
|
|
|
<p className='text-green-500'>5 days left</p> |
|
|
|
)} |
|
|
|
{!(activeData?.status === 'no_subscription') && <h3 className="before:content-'' relative mt-1 bg-light text-lg font-semibold text-heading before:absolute before:-top-px before:h-7 before:w-1 before:rounded-tr-md before:rounded-br-md before:bg-accent ltr:before:-left-6 rtl:before:-right-6 md:before:-top-0.5 md:ltr:before:-left-7 md:rtl:before:-right-7 lg:before:h-8"> |
|
|
|
{/* {t('text-7day-subscription')} */} |
|
|
|
{activeData?.subscription?.title} |
|
|
|
</h3>} |
|
|
|
{activeData?.days_left && ( |
|
|
|
<div className="p-2 bg-green-50"> |
|
|
|
<p className="text-green-500">{activeData?.days_left} days left</p> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
|
|
|
|
{/* <div className="grid w-full grid-cols-1 gap-5 sm:grid-cols-2 xl:grid-cols-4"> */} |
|
|
|
<div className="relative w-full max-w-[1500px] h-52"> {/* Use relative positioning for next/image with fill */} |
|
|
|
<div className="relative w-full max-w-[1500px] h-52"> |
|
|
|
{' '} |
|
|
|
{/* Use relative positioning for next/image with fill */} |
|
|
|
<Image |
|
|
|
src="/image/subscriptions/Frame 1000005697.webp" |
|
|
|
alt="subscription plan" |
|
|
|