feat: implement plan upgrade logic with prorated pricing and MercadoPago integration
This commit is contained in:
@@ -4,20 +4,41 @@ import Link from "next/link";
|
||||
import { useSessionStore } from "@core/Store/Sesion.Store";
|
||||
import style from "./style.module.css";
|
||||
|
||||
export default function CTABtn() {
|
||||
type CTABtnProps = {
|
||||
className?: string;
|
||||
secondaryClassName?: string;
|
||||
signedOutText?: string;
|
||||
signedInText?: string;
|
||||
showSecondaryWhenSignedOut?: boolean;
|
||||
};
|
||||
|
||||
export default function CTABtn({
|
||||
className = style.ctaBtn,
|
||||
secondaryClassName,
|
||||
signedOutText = "Crear mi cuenta gratis",
|
||||
signedInText = "Ver planes",
|
||||
showSecondaryWhenSignedOut = false,
|
||||
}: CTABtnProps) {
|
||||
const SessionInfo = useSessionStore();
|
||||
|
||||
if (SessionInfo.loged) {
|
||||
return (
|
||||
<Link href="/landing/pricing" className={style.ctaBtn}>
|
||||
Ver planes
|
||||
<Link href="/landing/pricing" className={className}>
|
||||
{signedInText}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Link href="/landing/signup" className={style.ctaBtn}>
|
||||
Crear mi cuenta gratis
|
||||
</Link>
|
||||
<>
|
||||
<Link href="/landing/signup" className={className}>
|
||||
{signedOutText}
|
||||
</Link>
|
||||
{showSecondaryWhenSignedOut && secondaryClassName && (
|
||||
<Link href="/landing/pricing" className={secondaryClassName}>
|
||||
Ver Planes
|
||||
</Link>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user