From 1ebd68befd4d93d6ac4a4bd8bc67306cbe8560a2 Mon Sep 17 00:00:00 2001 From: azeeee05 Date: Thu, 20 Aug 2026 15:14:03 +0530 Subject: [PATCH] feat: create AddPolicyEngine component with dynamic condition and action builders --- .../components/AddPolicyEngine.tsx | 81 ++++++++++++++++++- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/src/app/policyEngine/components/AddPolicyEngine.tsx b/src/app/policyEngine/components/AddPolicyEngine.tsx index 7d47a38..302e12f 100644 --- a/src/app/policyEngine/components/AddPolicyEngine.tsx +++ b/src/app/policyEngine/components/AddPolicyEngine.tsx @@ -15,6 +15,7 @@ import { CustomSwitch, CustomCheckBox, CustomLoader, + Skeleton, } from '../../../components/custom'; import CustomSuccessModal from '../../../components/custom/CustomSuccessModal'; import { @@ -544,7 +545,7 @@ export default function AddPolicyEngine() { jurisdictionId: Array.isArray(jurisdiction) && jurisdiction.length > 0 ? String(jurisdiction[0]) : undefined, jurisdictionIds: Array.isArray(jurisdiction) ? jurisdiction.map(String) : [], description: description || undefined, - status: isDeploy ? 'active' : 'draft', + status: isDeploy ? status.toLowerCase() : 'draft', audienceType: audienceType === 'Selected Cohorts' ? 'COHORT' : 'ALL', targetAudiences: audienceType === 'Selected Cohorts' @@ -759,8 +760,82 @@ export default function AddPolicyEngine() { if (loadingPolicy) { return ( -
- +
+ {/* ─── Header Skeleton ────────────────────────────────────────────── */} +
+
+
+ +
+
+ + +
+
+
+ + {/* ─── Body Content Skeleton ──────────────────────────────────────── */} +
+
+ + {/* Policy Information Card */} +
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+ + {/* Target Audience Card */} +
+
+ + +
+
+
+ + +
+
+
+ + {/* Rule Engine Card */} +
+
+
+ + +
+ +
+
+ +
+
+ +
+
); }