Upload frontend/src/views/officer/PolicyEditorView.tsx with huggingface_hub
Browse files
frontend/src/views/officer/PolicyEditorView.tsx
CHANGED
|
@@ -19,6 +19,40 @@ export const PolicyEditorView: React.FC = () => {
|
|
| 19 |
|
| 20 |
const [savedSuccess, setSavedSuccess] = useState<boolean>(false);
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
const handleSave = () => {
|
| 23 |
setSavedSuccess(true);
|
| 24 |
setTimeout(() => setSavedSuccess(false), 3000);
|
|
@@ -51,6 +85,74 @@ export const PolicyEditorView: React.FC = () => {
|
|
| 51 |
/>
|
| 52 |
)}
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
{/* Plain-English Live Preview Box */}
|
| 55 |
<div className="bg-gradient-to-r from-brand-900 to-indigo-950 text-white p-6 rounded-2xl shadow-lg border border-brand-800 space-y-3">
|
| 56 |
<div className="flex items-center gap-2">
|
|
|
|
| 19 |
|
| 20 |
const [savedSuccess, setSavedSuccess] = useState<boolean>(false);
|
| 21 |
|
| 22 |
+
const [activePolicyPreset, setActivePolicyPreset] = useState<number>(1);
|
| 23 |
+
|
| 24 |
+
const applyPolicyPreset = (presetIndex: number) => {
|
| 25 |
+
setActivePolicyPreset(presetIndex);
|
| 26 |
+
if (presetIndex === 1) {
|
| 27 |
+
setPolicyName("Policy 1: Strict One-Offer with Dream Tier Exception");
|
| 28 |
+
setMaxOffers(1);
|
| 29 |
+
setDreamThreshold(10.0);
|
| 30 |
+
setAllowDreamOffers(true);
|
| 31 |
+
setUseFixedPay(false);
|
| 32 |
+
setThresholdInclusive(true);
|
| 33 |
+
setCountOffCampus(true);
|
| 34 |
+
setRevokedOffersCount(false);
|
| 35 |
+
} else if (presetIndex === 2) {
|
| 36 |
+
setPolicyName("Policy 2: Progressive Salary Multiplier (1.5x Rule)");
|
| 37 |
+
setMaxOffers(2);
|
| 38 |
+
setDreamThreshold(12.0);
|
| 39 |
+
setAllowDreamOffers(true);
|
| 40 |
+
setUseFixedPay(false);
|
| 41 |
+
setThresholdInclusive(true);
|
| 42 |
+
setCountOffCampus(true);
|
| 43 |
+
setRevokedOffersCount(false);
|
| 44 |
+
} else if (presetIndex === 3) {
|
| 45 |
+
setPolicyName("Policy 3: Tier-Based Quota Policy (Standard, Dream, Super-Dream)");
|
| 46 |
+
setMaxOffers(3);
|
| 47 |
+
setDreamThreshold(8.0);
|
| 48 |
+
setAllowDreamOffers(true);
|
| 49 |
+
setUseFixedPay(false);
|
| 50 |
+
setThresholdInclusive(true);
|
| 51 |
+
setCountOffCampus(false);
|
| 52 |
+
setRevokedOffersCount(false);
|
| 53 |
+
}
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
const handleSave = () => {
|
| 57 |
setSavedSuccess(true);
|
| 58 |
setTimeout(() => setSavedSuccess(false), 3000);
|
|
|
|
| 85 |
/>
|
| 86 |
)}
|
| 87 |
|
| 88 |
+
{/* Three College Offer Policies Preset Selector */}
|
| 89 |
+
<div className="bg-[#0d1527] border border-[#1b2b4d] rounded-2xl p-5 shadow-md space-y-3">
|
| 90 |
+
<div className="flex items-center justify-between">
|
| 91 |
+
<div className="flex items-center gap-2">
|
| 92 |
+
<Shield className="w-4 h-4 text-emerald-400" />
|
| 93 |
+
<h3 className="text-xs font-bold text-white uppercase tracking-wider">
|
| 94 |
+
Three College Offer Policies (with Ambiguities)
|
| 95 |
+
</h3>
|
| 96 |
+
</div>
|
| 97 |
+
<span className="text-[11px] text-slate-400 font-medium">As written by institutional placement cells</span>
|
| 98 |
+
</div>
|
| 99 |
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-2.5">
|
| 100 |
+
<button
|
| 101 |
+
type="button"
|
| 102 |
+
onClick={() => applyPolicyPreset(1)}
|
| 103 |
+
className={`p-3 rounded-xl border text-left transition-all cursor-pointer ${
|
| 104 |
+
activePolicyPreset === 1
|
| 105 |
+
? "bg-gradient-to-r from-blue-900/60 to-emerald-950/60 text-white border-emerald-500 shadow-xs"
|
| 106 |
+
: "bg-[#080e1c] text-slate-300 border-[#1b2b4d] hover:bg-[#111d38]"
|
| 107 |
+
}`}
|
| 108 |
+
>
|
| 109 |
+
<div className="text-xs font-bold flex items-center justify-between">
|
| 110 |
+
<span>Policy 1: Strict One-Offer</span>
|
| 111 |
+
<span className="text-[10px] text-emerald-400 font-mono">1 Offer</span>
|
| 112 |
+
</div>
|
| 113 |
+
<p className="text-[11px] text-slate-400 mt-1 leading-snug">
|
| 114 |
+
Dream Tier ≥ 10 LPA. Ambiguities: Off-campus offer reporting & Base pay vs CTC.
|
| 115 |
+
</p>
|
| 116 |
+
</button>
|
| 117 |
+
|
| 118 |
+
<button
|
| 119 |
+
type="button"
|
| 120 |
+
onClick={() => applyPolicyPreset(2)}
|
| 121 |
+
className={`p-3 rounded-xl border text-left transition-all cursor-pointer ${
|
| 122 |
+
activePolicyPreset === 2
|
| 123 |
+
? "bg-gradient-to-r from-blue-900/60 to-emerald-950/60 text-white border-emerald-500 shadow-xs"
|
| 124 |
+
: "bg-[#080e1c] text-slate-300 border-[#1b2b4d] hover:bg-[#111d38]"
|
| 125 |
+
}`}
|
| 126 |
+
>
|
| 127 |
+
<div className="text-xs font-bold flex items-center justify-between">
|
| 128 |
+
<span>Policy 2: 1.5x Multiplier</span>
|
| 129 |
+
<span className="text-[10px] text-emerald-400 font-mono">2 Offers</span>
|
| 130 |
+
</div>
|
| 131 |
+
<p className="text-[11px] text-slate-400 mt-1 leading-snug">
|
| 132 |
+
Hold up to 2 offers. Ambiguities: Concurrent drive precedence & lateral entry diploma.
|
| 133 |
+
</p>
|
| 134 |
+
</button>
|
| 135 |
+
|
| 136 |
+
<button
|
| 137 |
+
type="button"
|
| 138 |
+
onClick={() => applyPolicyPreset(3)}
|
| 139 |
+
className={`p-3 rounded-xl border text-left transition-all cursor-pointer ${
|
| 140 |
+
activePolicyPreset === 3
|
| 141 |
+
? "bg-gradient-to-r from-blue-900/60 to-emerald-950/60 text-white border-emerald-500 shadow-xs"
|
| 142 |
+
: "bg-[#080e1c] text-slate-300 border-[#1b2b4d] hover:bg-[#111d38]"
|
| 143 |
+
}`}
|
| 144 |
+
>
|
| 145 |
+
<div className="text-xs font-bold flex items-center justify-between">
|
| 146 |
+
<span>Policy 3: Tiered Quota</span>
|
| 147 |
+
<span className="text-[10px] text-emerald-400 font-mono">3 Offers</span>
|
| 148 |
+
</div>
|
| 149 |
+
<p className="text-[11px] text-slate-400 mt-1 leading-snug">
|
| 150 |
+
Standard / Dream / Super-Dream tiers. Ambiguities: Re-evaluation timing & lock rules.
|
| 151 |
+
</p>
|
| 152 |
+
</button>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
{/* Plain-English Live Preview Box */}
|
| 157 |
<div className="bg-gradient-to-r from-brand-900 to-indigo-950 text-white p-6 rounded-2xl shadow-lg border border-brand-800 space-y-3">
|
| 158 |
<div className="flex items-center gap-2">
|