import { FormButtons } from '@components/admin/FormButtons.js'; import Area from '@components/common/Area.js'; import { Form } from '@components/common/form/Form.js'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@components/common/ui/Card.js'; import React from 'react'; import { toast } from 'react-toastify'; interface CouponNewFormProps { action: string; gridUrl: string; } export default function CouponNewForm({ action, gridUrl }: CouponNewFormProps) { return (
{ toast.success('Coupon created successfully!'); const editUrl = response.data.links.find( (link) => link.rel === 'edit' ).href; window.location.href = editUrl; }} submitBtn={false} >
General Information The general information about the coupon. Discount Type The type of discount applied by the coupon.
Order conditions The conditions related to the order for the coupon to be applied.
Customer conditions The conditions related to the customer for the coupon to be applied.
); } export const layout = { areaId: 'content', sortOrder: 10 }; export const query = ` query Query { action: url(routeId: "createCoupon") gridUrl: url(routeId: "couponGrid") } `;