payments
This commit is contained in:
parent
73a411c9b2
commit
c8c9d216ee
|
@ -53,8 +53,8 @@ const ActiveBadge = () => {
|
||||||
export default function Payments() {
|
export default function Payments() {
|
||||||
const { data: user } = useSWR(`${apiPrefix}/user`, fetcher);
|
const { data: user } = useSWR(`${apiPrefix}/user`, fetcher);
|
||||||
const [selectedPlan, setSelectedPlan] = useState(plans[0]);
|
const [selectedPlan, setSelectedPlan] = useState(plans[0]);
|
||||||
const activePlan = plans.find(({ tier }) => user?.tier === tier);
|
const activePlan = plans.find((plan) => user?.tier === plan?.tier);
|
||||||
const isFreePlan = ({ tier }) => tier === 1;
|
const isFreePlan = (plan) => plan?.tier === 1;
|
||||||
const handleSubscribe = async () => {
|
const handleSubscribe = async () => {
|
||||||
try {
|
try {
|
||||||
const price = selectedPlan.stripe;
|
const price = selectedPlan.stripe;
|
||||||
|
|
Reference in New Issue