import { Box, HStack, Icon, SimpleGrid, Spinner, Text } from '@chakra-ui/react'; import { __ } from '@wordpress/i18n'; import React from 'react'; import { FiArrowRight } from 'react-icons/fi'; import { LuPencilLine, LuSparkles } from 'react-icons/lu'; import { templatesScriptData } from '../utils/global'; interface CreateFormCTAProps { onCreateWithAI?: () => void; onCreateBlank?: () => void; isCreatingBlank?: boolean; } // "Create with AI" is disabled (shown greyed-out, not clickable) on local / // development sites where the AI gateway is unavailable. const AI_ENABLED = !!templatesScriptData?.aiEnabled; const CreateFormCTA: React.FC = ({ onCreateWithAI, onCreateBlank, isCreatingBlank = false, }) => { return ( {/* AI Card */} AI_ENABLED && onCreateWithAI && onCreateWithAI()} transition="border-color 0.2s, box-shadow 0.2s" _hover={AI_ENABLED ? { borderColor: 'rgba(117,69,187,0.4)', boxShadow: '0 10px 30px -15px rgba(117,69,187,0.25)', } : {}} > {/* Gradient overlay decorations */} {/* Icon + NEW badge row */} {__('New', 'everest-forms')} {/* Title */} {__('Create Form Using AI', 'everest-forms')} {/* Description */} {__('Describe your form in plain words and let AI build the fields for you in seconds.', 'everest-forms')} {/* CTA link */} {AI_ENABLED ? ( <> {__('Get Started', 'everest-forms')} ) : ( {__('AI service is currently unavailable for local and staging site.', 'everest-forms')} )} {/* Scratch Card */} {/* Icon */} {isCreatingBlank ? : } {/* Title */} {__('Create from Scratch', 'everest-forms')} {/* Description */} {__('Start with a blank canvas and design your form field by field with full control.', 'everest-forms')} {/* CTA link */} {__('Continue', 'everest-forms')} ); }; export default CreateFormCTA;