45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { useSessionStore } from "@core/Store/Sesion.Store";
|
|
import style from "./style.module.css";
|
|
|
|
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={className}>
|
|
{signedInText}
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Link href="/landing/signup" className={className}>
|
|
{signedOutText}
|
|
</Link>
|
|
{showSecondaryWhenSignedOut && secondaryClassName && (
|
|
<Link href="/landing/pricing" className={secondaryClassName}>
|
|
Ver Planes
|
|
</Link>
|
|
)}
|
|
</>
|
|
);
|
|
}
|