Update frontend/src/components/admin/PlanForm.jsx
Browse files
frontend/src/components/admin/PlanForm.jsx
CHANGED
|
@@ -11,7 +11,6 @@ export default function PlanForm({ plan, onSave, onCancel, isLoading }) {
|
|
| 11 |
const [name, setName] = useState("");
|
| 12 |
const [billingPeriod, setBillingPeriod] = useState("monthly");
|
| 13 |
const [price, setPrice] = useState("");
|
| 14 |
-
const [stripeLink, setStripeLink] = useState("");
|
| 15 |
const [description, setDescription] = useState("");
|
| 16 |
const [maxStudents, setMaxStudents] = useState("1");
|
| 17 |
const [isActive, setIsActive] = useState(true);
|
|
@@ -21,7 +20,6 @@ export default function PlanForm({ plan, onSave, onCancel, isLoading }) {
|
|
| 21 |
setName(plan.name || "");
|
| 22 |
setBillingPeriod(plan.billing_period || "monthly");
|
| 23 |
setPrice(plan.price != null ? String(plan.price) : "");
|
| 24 |
-
setStripeLink(plan.stripe_link || "");
|
| 25 |
setDescription(plan.description || "");
|
| 26 |
setMaxStudents(String(plan.max_students || 1));
|
| 27 |
setIsActive(plan.is_active ?? true);
|
|
@@ -29,7 +27,6 @@ export default function PlanForm({ plan, onSave, onCancel, isLoading }) {
|
|
| 29 |
setName("");
|
| 30 |
setBillingPeriod("monthly");
|
| 31 |
setPrice("");
|
| 32 |
-
setStripeLink("");
|
| 33 |
setDescription("");
|
| 34 |
setMaxStudents("1");
|
| 35 |
setIsActive(true);
|
|
@@ -45,7 +42,6 @@ export default function PlanForm({ plan, onSave, onCancel, isLoading }) {
|
|
| 45 |
name,
|
| 46 |
billing_period: billingPeriod,
|
| 47 |
price: priceNumber,
|
| 48 |
-
stripe_link: stripeLink || null,
|
| 49 |
description: description || null,
|
| 50 |
max_students: maxStudentsNumber,
|
| 51 |
is_active: isActive,
|
|
@@ -119,22 +115,6 @@ export default function PlanForm({ plan, onSave, onCancel, isLoading }) {
|
|
| 119 |
</div>
|
| 120 |
|
| 121 |
<div className="space-y-2">
|
| 122 |
-
<div>
|
| 123 |
-
<label className="block text-xs font-medium text-stone-700 mb-1">
|
| 124 |
-
Stripe payment link
|
| 125 |
-
</label>
|
| 126 |
-
<input
|
| 127 |
-
type="url"
|
| 128 |
-
className="w-full rounded-lg border border-stone-200 px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500"
|
| 129 |
-
placeholder="https://buy.stripe.com/..."
|
| 130 |
-
value={stripeLink}
|
| 131 |
-
onChange={(e) => setStripeLink(e.target.value)}
|
| 132 |
-
/>
|
| 133 |
-
<p className="text-[11px] text-stone-500 mt-1">
|
| 134 |
-
Paste the Stripe Checkout link for this plan.
|
| 135 |
-
</p>
|
| 136 |
-
</div>
|
| 137 |
-
|
| 138 |
<div>
|
| 139 |
<label className="block text-xs font-medium text-stone-700 mb-1">
|
| 140 |
Description
|
|
|
|
| 11 |
const [name, setName] = useState("");
|
| 12 |
const [billingPeriod, setBillingPeriod] = useState("monthly");
|
| 13 |
const [price, setPrice] = useState("");
|
|
|
|
| 14 |
const [description, setDescription] = useState("");
|
| 15 |
const [maxStudents, setMaxStudents] = useState("1");
|
| 16 |
const [isActive, setIsActive] = useState(true);
|
|
|
|
| 20 |
setName(plan.name || "");
|
| 21 |
setBillingPeriod(plan.billing_period || "monthly");
|
| 22 |
setPrice(plan.price != null ? String(plan.price) : "");
|
|
|
|
| 23 |
setDescription(plan.description || "");
|
| 24 |
setMaxStudents(String(plan.max_students || 1));
|
| 25 |
setIsActive(plan.is_active ?? true);
|
|
|
|
| 27 |
setName("");
|
| 28 |
setBillingPeriod("monthly");
|
| 29 |
setPrice("");
|
|
|
|
| 30 |
setDescription("");
|
| 31 |
setMaxStudents("1");
|
| 32 |
setIsActive(true);
|
|
|
|
| 42 |
name,
|
| 43 |
billing_period: billingPeriod,
|
| 44 |
price: priceNumber,
|
|
|
|
| 45 |
description: description || null,
|
| 46 |
max_students: maxStudentsNumber,
|
| 47 |
is_active: isActive,
|
|
|
|
| 115 |
</div>
|
| 116 |
|
| 117 |
<div className="space-y-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
<div>
|
| 119 |
<label className="block text-xs font-medium text-stone-700 mb-1">
|
| 120 |
Description
|