| 1 | "use client"; |
| 2 | |
| 3 | import { useState } from "react"; |
| 4 | |
| 5 | import { Label } from "@/components/ui/label"; |
| 6 | import { SubscriptionModal } from "../../SubscriptionModal"; |
| 7 | |
| 8 | export function PremiumFeaturesSection() { |
| 9 | const [subscriptionModalOpen, setSubscriptionModalOpen] = useState(false); |
| 10 | |
| 11 | const handlePremiumFeatureClick = (e: React.MouseEvent) => { |
| 12 | e.preventDefault(); |
| 13 | e.stopPropagation(); |
| 14 | setSubscriptionModalOpen(true); |
| 15 | }; |
| 16 | return ( |
| 17 | <> |
| 18 | <SubscriptionModal |
| 19 | open={subscriptionModalOpen} |
| 20 | onOpenChange={setSubscriptionModalOpen} |
| 21 | /> |
| 22 | <div className="space-y-3"> |
| 23 | <Label className="text-sm font-semibold">Animations</Label> |
| 24 | <div |
| 25 | className="flex cursor-pointer items-center justify-between rounded-lg border p-3 hover:bg-accent/50" |
| 26 | onClick={handlePremiumFeatureClick} |
| 27 | role="button" |
| 28 | tabIndex={0} |
| 29 | onKeyDown={(event) => { |
| 30 | if (event.key === "Enter" || event.key === " ") { |
| 31 | event.preventDefault(); |
| 32 | event.currentTarget.click(); |
| 33 | } |
| 34 | }} |
| 35 | > |
| 36 | <div className="flex items-center gap-2"> |
| 37 | <span className="text-sm">Enable animations</span> |
| 38 | <span className="flex items-center gap-1 rounded-full bg-linear-to-r from-amber-500 to-orange-500 px-2 py-0.5 text-xs font-semibold text-white"> |
| 39 | <span>👑</span> PRO |
| 40 | </span> |
| 41 | </div> |
| 42 | <div className="pointer-events-none"> |
| 43 | <input |
| 44 | aria-label="premium features section control" |
| 45 | type="checkbox" |
| 46 | className="sr-only" |
| 47 | /> |
| 48 | <div className="relative h-6 w-11 rounded-full bg-muted"> |
| 49 | <div className="absolute top-1 left-1 size-4 rounded-full bg-background transition-transform" /> |
| 50 | </div> |
| 51 | </div> |
| 52 | </div> |
| 53 | </div> |
| 54 | |
| 55 | <div className="space-y-3"> |
| 56 | <Label className="text-sm font-semibold">Branding</Label> |
| 57 | <div |
| 58 | className="flex cursor-pointer items-center justify-between rounded-lg border p-3 hover:bg-accent/50" |
| 59 | onClick={handlePremiumFeatureClick} |
| 60 | role="button" |
| 61 | tabIndex={0} |
| 62 | onKeyDown={(event) => { |
| 63 | if (event.key === "Enter" || event.key === " ") { |
| 64 | event.preventDefault(); |
| 65 | event.currentTarget.click(); |
| 66 | } |
| 67 | }} |
| 68 | > |
| 69 | <div className="flex items-center gap-2"> |
| 70 | <span className="text-sm">Remove ALLWEONE® branding</span> |
| 71 | <span className="flex items-center gap-1 rounded-full bg-linear-to-r from-amber-500 to-orange-500 px-2 py-0.5 text-xs font-semibold text-white"> |
| 72 | <span>👑</span> PRO |
| 73 | </span> |
| 74 | </div> |
| 75 | <div className="pointer-events-none"> |
| 76 | <input |
| 77 | aria-label="premium features section control" |
| 78 | type="checkbox" |
| 79 | className="sr-only" |
| 80 | /> |
| 81 | <div className="relative h-6 w-11 rounded-full bg-muted"> |
| 82 | <div className="absolute top-1 left-1 size-4 rounded-full bg-background transition-transform" /> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | </> |
| 88 | ); |
| 89 | } |
| 90 |