From 150434ab66e1fb8a3b921aeefc6f05b20e0d437e Mon Sep 17 00:00:00 2001 From: Rohit Date: Mon, 4 Aug 2025 23:11:16 +0530 Subject: [PATCH] chore: cleanup --- .../robot/pages/RobotIntegrationPage.tsx | 60 ------------------- 1 file changed, 60 deletions(-) diff --git a/src/components/robot/pages/RobotIntegrationPage.tsx b/src/components/robot/pages/RobotIntegrationPage.tsx index ea8295c0..b18e1cd0 100644 --- a/src/components/robot/pages/RobotIntegrationPage.tsx +++ b/src/components/robot/pages/RobotIntegrationPage.tsx @@ -73,7 +73,6 @@ export const RobotIntegrationPage = ({ const navigate = useNavigate(); const location = useLocation(); - // Extract robotId and integrationType from URL const pathSegments = location.pathname.split('/'); const robotsIndex = pathSegments.findIndex(segment => segment === 'robots' || segment === 'prebuilt-robots'); const integrateIndex = pathSegments.findIndex(segment => segment === 'integrate'); @@ -103,7 +102,6 @@ export const RobotIntegrationPage = ({ const [airtableTables, setAirtableTables] = useState<{ id: string; name: string }[]>([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); - const [isLoading, setIsLoadingAction] = useState(false); const [showWebhookForm, setShowWebhookForm] = useState(false); const [editingWebhook, setEditingWebhook] = useState(null); @@ -130,7 +128,6 @@ export const RobotIntegrationPage = ({ "googleSheets" | "airtable" | "webhook" | null >(integrationType); - // --- AUTHENTICATION --- const authenticateWithGoogle = () => { if (!recordingId) { console.error("Cannot authenticate: recordingId is null"); @@ -151,7 +148,6 @@ export const RobotIntegrationPage = ({ window.location.href = `${apiUrl}/auth/airtable?robotId=${recordingId}&redirectUrl=${encodeURIComponent(redirectUrl)}`; }; - // --- WEBHOOKS --- const validateWebhookData = ( url: string, events: string[], @@ -296,7 +292,6 @@ export const RobotIntegrationPage = ({ } }; - // --- DATA FETCHING & STATE MANAGEMENT --- useEffect(() => { setSelectedIntegrationType(integrationType); setSettings(prev => ({ ...prev, integrationType: integrationType || "airtable" })); @@ -319,21 +314,11 @@ export const RobotIntegrationPage = ({ } }, [recordingId, selectedIntegrationType]); - // --- NAVIGATION & ACTIONS --- - const handleTabChange = (event: React.SyntheticEvent, newValue: string) => { - if (!recordingId) return; - const newIntegrationType = newValue as "googleSheets" | "airtable" | "webhook"; - setSelectedIntegrationType(newIntegrationType); - const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots"; - navigate(`${basePath}/${recordingId}/integrate/${newValue}`); - }; - const handleCancel = () => { const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots"; navigate(basePath); }; - // --- GOOGLE SHEETS --- const fetchSpreadsheetFiles = async () => { try { setLoading(true); @@ -402,7 +387,6 @@ export const RobotIntegrationPage = ({ } }; - // --- AIRTABLE --- const fetchAirtableBases = async () => { try { setLoading(true); @@ -497,7 +481,6 @@ export const RobotIntegrationPage = ({ } }; - // --- RENDER METHODS --- const renderGoogleSheetsIntegration = () => ( <> @@ -620,49 +603,6 @@ export const RobotIntegrationPage = ({ ); - const renderWebhookIntegration = () => ( - - Webhook Integration - Configure webhooks to receive real-time notifications about robot events - {!showWebhookForm && ( - - )} - {showWebhookForm && ( - - - {editingWebhook ? "Edit Webhook" : "Add New Webhook"} - setNewWebhook((prev) => ({ ...prev, url: e.target.value }))} error={!!urlError} helperText={urlError} sx={{ mb: 2 }}/> - setNewWebhook((prev) => ({ ...prev, active: e.target.checked }))}/>} label="Active"/> - - - - - - - )} - {settings.webhooks && settings.webhooks.length > 0 && ( - - - URLStatusActions - - {settings.webhooks.map((webhook) => ( - - {webhook.url} - - - { setNewWebhook(webhook); setEditingWebhook(webhook.id); setShowWebhookForm(true); }} size="small"> - testWebhookSetting(webhook.id)} size="small" disabled={loading}> - deleteWebhookSetting(webhook.id)} size="small" color="error"> - - - ))} - -
-
- )} -
- ); - const getIntegrationTitle = () => { switch (selectedIntegrationType) { case "googleSheets":