diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/Forms/ComputePaymentForm.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/Forms/ComputePaymentForm.jsx
index d40f0a3..b49c61a 100644
--- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/Forms/ComputePaymentForm.jsx
+++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/Forms/ComputePaymentForm.jsx
@@ -1,3 +1,129 @@
-export default function ComputePaymentForm({ mutate }) {
- return
ComputePaymentForm
;
+import { Box, Button, DialogActions, FormControl, InputLabel, MenuItem, Select, TextField } from "@mui/material";
+import { useEffect, useState } from "react";
+import { Controller, useForm, useWatch } from "react-hook-form";
+
+export default function ComputePaymentForm({ mutate, onClose }) {
+ const [isSubmitting, setIsSubmitting] = useState(false);
+
+ const price_fee = 1; // TODO: Replace with value from .env
+
+ const { control, handleSubmit, setValue } = useForm({
+ defaultValues: {
+ expert_description: "",
+ traffic: "",
+ road_type: "",
+ position: "",
+ final_area_space: "",
+ payment_amount: "",
+ },
+ });
+
+ // Watch dependent fields for recalculation
+ const { traffic, road_type, position, final_area_space } = useWatch({
+ control,
+ });
+
+ useEffect(() => {
+ const t = parseFloat(traffic || "");
+ const r = parseFloat(road_type || "");
+ const p = parseFloat(position || "");
+ const area = parseFloat(final_area_space || "");
+
+ if (t && r && p && area) {
+ const result = t * r * p * area * price_fee;
+ setValue("payment_amount", result.toString());
+ } else {
+ setValue("payment_amount", "");
+ }
+ }, [traffic, road_type, position, final_area_space, price_fee, setValue]);
+
+ const onSubmit = (data) => {
+ console.log(data);
+ setIsSubmitting(true);
+ mutate();
+ onClose();
+ };
+
+ return (
+
+
+ (
+
+ ترافیک
+
+
+ )}
+ />
+
+ (
+
+ نوع راه
+
+
+ )}
+ />
+
+
+
+ (
+
+ موقعیت اقتصادی
+
+
+ )}
+ />
+
+ (
+
+ )}
+ />
+
+
+ (
+
+ )}
+ />
+
+ }
+ />
+
+
+
+
+
+
+ );
}