From 796e09c345926869fc180442206a59520ba1d61e Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 19 Nov 2024 00:08:12 +0530 Subject: [PATCH] feat: add duplicate robot instructions --- src/components/molecules/RobotDuplicate.tsx | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/molecules/RobotDuplicate.tsx b/src/components/molecules/RobotDuplicate.tsx index ae963e6b..c792c3a0 100644 --- a/src/components/molecules/RobotDuplicate.tsx +++ b/src/components/molecules/RobotDuplicate.tsx @@ -96,17 +96,17 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia notify('error', 'Target URL is required.'); return; } - + console.log("handle save"); try { const success = await duplicateRecording(robot.recording_meta.id, targetUrl); - + if (success) { notify('success', 'Target URL updated successfully.'); handleStart(robot); // Inform parent about the updated robot handleClose(); // Close the modal - + window.location.reload(); } else { notify('error', 'Failed to update the Target URL. Please try again.'); @@ -116,7 +116,7 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia console.error('Error updating Target URL:', error); } }; - + return ( <> - Duplicate Robot + Duplicate Robot { robot && ( <> + + Easily duplicate your robots to handle pages with a similar structure. For instance: + + If you've created a robot for producthunt.com/topics/api, you can duplicate it to scrape similar pages like producthunt.com/topics/database without starting from scratch. + How it works: + + Select a robot you want to duplicate. + Use the duplication feature to create a copy of the robot. + Customize the robot if needed, ensuring it fits the new page structure. + ⚠️ Ensure the new page has a similar structure to the original for seamless functionality. + + This feature saves you time and effort while keeping your workflow streamlined for similar pages. +