diff --git a/src/components/robot/pages/RobotCreate.tsx b/src/components/robot/pages/RobotCreate.tsx index 70058642..0e76fac4 100644 --- a/src/components/robot/pages/RobotCreate.tsx +++ b/src/components/robot/pages/RobotCreate.tsx @@ -13,21 +13,47 @@ import { Card, CircularProgress, Container, - CardContent + CardContent, + Tabs, + Tab } from '@mui/material'; -import { ArrowBack, PlayCircleOutline, Article } from '@mui/icons-material'; +import { ArrowBack, PlayCircleOutline, Article, Code, Description } from '@mui/icons-material'; import { useGlobalInfoStore } from '../../../context/globalInfo'; import { canCreateBrowserInState, getActiveBrowserId, stopRecording } from '../../../api/recording'; import { AuthContext } from '../../../context/auth'; import { GenericModal } from '../../ui/GenericModal'; +interface TabPanelProps { + children?: React.ReactNode; + index: number; + value: number; +} + +function TabPanel(props: TabPanelProps) { + const { children, value, index, ...other } = props; + + return ( + + ); +} + const RobotCreate: React.FC = () => { const { t } = useTranslation(); const navigate = useNavigate(); - const { setBrowserId, setRecordingUrl, notify, setRecordingId } = useGlobalInfoStore(); + const { setBrowserId, setRecordingUrl, notify, setRecordingId, setRerenderRobots } = useGlobalInfoStore(); + const [tabValue, setTabValue] = useState(0); const [url, setUrl] = useState(''); + const [markdownRobotName, setMarkdownRobotName] = useState(''); const [needsLogin, setNeedsLogin] = useState(false); const [isLoading, setIsLoading] = useState(false); const [isWarningModalOpen, setWarningModalOpen] = useState(false); @@ -36,6 +62,10 @@ const RobotCreate: React.FC = () => { const { state } = React.useContext(AuthContext); const { user } = state; + const handleTabChange = (event: React.SyntheticEvent, newValue: number) => { + setTabValue(newValue); + }; + const handleStartRecording = async () => { if (!url.trim()) { @@ -146,11 +176,31 @@ const RobotCreate: React.FC = () => { - New Data Extraction Robot + Create New Robot - + + + } + iconPosition="start" + label="Data Extraction Robot" + id="robot-tab-0" + aria-controls="robot-tabpanel-0" + /> + } + iconPosition="start" + label="Markdown Robot" + id="robot-tab-1" + aria-controls="robot-tabpanel-1" + /> + + + + + {/* Logo (kept as original) */} { + + + + + + Maxun Logo + + + Create Markdown Robot + + + Convert any webpage to clean markdown format + + + + setMarkdownRobotName(e.target.value)} + label="Robot Name" + sx={{ mb: 2 }} + /> + setUrl(e.target.value)} + label="URL to convert" + /> + + + + + + diff --git a/src/components/robot/pages/RobotEditPage.tsx b/src/components/robot/pages/RobotEditPage.tsx index 80671c1f..d5e7cb2d 100644 --- a/src/components/robot/pages/RobotEditPage.tsx +++ b/src/components/robot/pages/RobotEditPage.tsx @@ -795,11 +795,6 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { navigate(basePath); }; - const lastPair = - robot?.recording.workflow[robot?.recording.workflow.length - 1]; - const targetUrl = lastPair?.what.find((action) => action.action === "goto") - ?.args?.[0]; - return ( { handleTargetUrlChange(e.target.value)} style={{ marginBottom: "20px" }} />