import React from 'react'; import { Box, Typography, Button, IconButton, Divider, useTheme } from '@mui/material'; import { ArrowBack } from '@mui/icons-material'; import { useNavigate, useLocation } from 'react-router-dom'; interface RobotConfigPageProps { title: string; children: React.ReactNode; onSave?: () => void; onCancel?: () => void; saveButtonText?: string; cancelButtonText?: string; showSaveButton?: boolean; showCancelButton?: boolean; isLoading?: boolean; icon?: React.ReactNode; onBackToSelection?: () => void; backToSelectionText?: string; } export const RobotConfigPage: React.FC = ({ title, children, onSave, onCancel, saveButtonText = "Save", cancelButtonText = "Cancel", showSaveButton = true, showCancelButton = true, isLoading = false, icon, onBackToSelection, backToSelectionText = "← Back" }) => { const theme = useTheme(); const handleBack = () => { if (onCancel) { onCancel(); } }; return ( {icon && ( {icon} )} {title} {children} {(showSaveButton || showCancelButton || onBackToSelection) && ( {onBackToSelection && ( )} {showCancelButton && ( )} {showSaveButton && onSave && ( )} )} ); };