Spaces:
Running

File size: 2,156 Bytes
0dcbaee
de55c35
 
385c360
de55c35
0dcbaee
de55c35
 
 
385c360
de55c35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dcbaee
de55c35
 
0dcbaee
de55c35
 
385c360
0dcbaee
de55c35
385c360
de55c35
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { Lock } from 'lucide-react';
import { FREE_LIMITS } from '../../../config/plans';

const PaywallModal = ({ showPaywall, setShowPaywall }) => {
  const { t } = useTranslation();
  const navigate = useNavigate();
  return (
    <AnimatePresence>
      {showPaywall && (
        <motion.div
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          exit={{ opacity: 0 }}
          className="absolute inset-0 z-50 flex items-center justify-center bg-primary/20 backdrop-blur-md p-4"
        >
          <motion.div
            initial={{ scale: 0.9 }}
            animate={{ scale: 1 }}
            className="bg-surface-container-lowest p-8 rough-border shadow-2xl max-w-md text-center"
          >
            <Lock size={48} className="mx-auto mb-4 text-primary" />
            <h2 className="text-4xl font-display-lg mb-4 text-primary">
              {t('plans.limit_title', 'Free plan limit')}
            </h2>
            <p className="text-xl mb-6 text-on-surface-variant font-medium">
              {t('plans.limit_nodes_desc', { count: FREE_LIMITS.nodesPerBoard, defaultValue: `A board on the Free plan can hold up to ${FREE_LIMITS.nodesPerBoard} nodes. Plus has no limits.` })}
            </p>
            <div className="flex flex-col gap-3">
              <button onClick={() => { setShowPaywall(false); navigate('/subscription'); }} className="w-full py-4 bg-primary text-on-primary font-bold rounded-xl shadow-lg hover:translate-y-[-2px] transition-all cursor-pointer">
                {t('plans.see_plus', 'See Plus')}
              </button>
              <button onClick={() => setShowPaywall(false)} className="w-full py-4 font-bold text-on-surface-variant border-2 border-primary/10 rounded-xl cursor-pointer">
                {t('pricing.maybe_later', 'Maybe Later')}
              </button>
            </div>
          </motion.div>
        </motion.div>
      )}
    </AnimatePresence>
  );
};

export default PaywallModal;