feat(hail-recon): Hail Recon integration — storm intel panel, hail history, auto storm mode, address monitoring

This commit is contained in:
Satyam-Rastogi
2026-05-18 15:50:59 +05:30
parent 912967fa3a
commit 9e2173fd43
13 changed files with 893 additions and 3 deletions
+22
View File
@@ -5,6 +5,7 @@ import { useTheme } from '../context/ThemeContext';
import { useAuth } from '../context/AuthContext';
import { useMockStore } from '../data/mockStore';
import { toast } from 'sonner';
import { useRegisterAddress } from '../hooks/useHailRecon';
import {
User, MapPin, Briefcase, Shield, Users,
ChevronLeft, Zap, FileText, Save, AlertCircle,
@@ -109,6 +110,7 @@ export default function CreateLeadPage() {
const { theme } = useTheme();
const { user } = useAuth();
const { addLead } = useMockStore();
const registerAddress = useRegisterAddress();
const isDark = theme === 'dark';
const navigate = useNavigate();
const [validationError, setValidationError] = useState('');
@@ -218,6 +220,26 @@ export default function CreateLeadPage() {
isQuickCapture,
});
// Silently register the address with Hail Recon for future monitoring
registerAddress({
id: savedLead?.id,
urgency: formData.urgency,
leadType: formData.jobType,
property: {
address: formData.address,
city: formData.city || 'Plano',
state: formData.state || 'TX',
zip: formData.zip || '',
lat: formData.lat || null,
lng: formData.lng || null,
},
customer: {
name: `${formData.firstName || ''} ${formData.lastName || ''}`.trim(),
phone: formData.phone || '',
email: formData.email || '',
},
});
toast.success(`Lead saved — ${formData.firstName} ${formData.lastName}`, {
description: formData.address || 'No address provided',
});