import { Form } from '@components/common/form/Form.js'; import { InputField } from '@components/common/form/InputField.js'; import { NumberField } from '@components/common/form/NumberField.js'; import { useAlertContext } from '@components/common/modal/Alert.js'; import RenderIfTrue from '@components/common/RenderIfTrue.js'; import { Button } from '@components/common/ui/Button.js'; import { CardContent } from '@components/common/ui/Card.js'; import React from 'react'; import { toast } from 'react-toastify'; interface StripeRefundButtonProps { refundAPI: string; order: { paymentStatus: { code: string; }; orderId: string; paymentMethod: string; grandTotal: { value: number; currency: string; }; }; } export default function StripeRefundButton({ refundAPI, order: { paymentStatus, orderId, paymentMethod, grandTotal } }: StripeRefundButtonProps) { const { openAlert, closeAlert, dispatchAlert } = useAlertContext(); const [loading, setLoading] = React.useState(false); return (
); } export const layout = { areaId: 'orderPaymentActions', sortOrder: 10 }; export const query = ` query Query { refundAPI: url(routeId: "refundPaymentIntent") order(uuid: getContextValue("orderId")) { orderId grandTotal { value currency } paymentStatus { code } paymentMethod } } `;