import { useState, useEffect } from "@wordpress/element"; // Import React for JSX and cloneElement import { LockOutlined } from "@ant-design/icons"; import { __ } from "@wordpress/i18n"; import apiFetch from "@wordpress/api-fetch"; import { Button, Input, Form, Alert } from "antd"; import { StarIcon } from "lucide-react"; import type { Element } from "@wordpress/element"; type Props = { modal?: boolean; refer: string; icon?: Element; title?: string; description?: string; buttonText?: string; className?: string; unlocked?: boolean; // Optional prop to indicate if the feature is unlocked }; const Premium = ({ modal = false, refer = "", icon = ( ), title = __("This is a Premium Feature", "swift-coupons-for-woocommerce"), description = __( "Unlock this feature by upgrading to Swift Coupons Premium!", "swift-coupons-for-woocommerce" ), buttonText = __("Get Premium", "swift-coupons-for-woocommerce"), className = "", unlocked = false, }: Props) => { // If modal is true, render the beautiful, highlighted modal design. if (modal) { return (
{/* Enhanced Icon with a background */}
{/* Content Section */}

{title}

{description}

{/* Upgraded Call-to-Action Button */} {buttonText}
); } // Original design for the non-modal (inline) version. return (
{icon}
{title}
{description}
{!unlocked && ( {buttonText} )}
); }; export default { Premium, };