refactor: move handleBack()
This commit is contained in:
@@ -677,6 +677,13 @@ export const RobotIntegrationPage = ({
|
|||||||
else return date.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
else return date.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleBack = () => {
|
||||||
|
if (!recordingId) return;
|
||||||
|
setSelectedIntegrationType(null);
|
||||||
|
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
|
||||||
|
navigate(`${basePath}/${recordingId}/integrate`);
|
||||||
|
};
|
||||||
|
|
||||||
// --- MAIN RENDER ---
|
// --- MAIN RENDER ---
|
||||||
if (!selectedIntegrationType && !integrationType) {
|
if (!selectedIntegrationType && !integrationType) {
|
||||||
return (
|
return (
|
||||||
@@ -758,13 +765,6 @@ export const RobotIntegrationPage = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBack = () => {
|
|
||||||
if (!recordingId) return;
|
|
||||||
setSelectedIntegrationType(null);
|
|
||||||
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
|
|
||||||
navigate(`${basePath}/${recordingId}/integrate`);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RobotConfigPage title={getIntegrationTitle()} onCancel={handleCancel} cancelButtonText={t("robot_edit.cancel")} showSaveButton={false} onBackToSelection={handleBack} backToSelectionText={"← " + t("right_panel.buttons.back")}>
|
<RobotConfigPage title={getIntegrationTitle()} onCancel={handleCancel} cancelButtonText={t("robot_edit.cancel")} showSaveButton={false} onBackToSelection={handleBack} backToSelectionText={"← " + t("right_panel.buttons.back")}>
|
||||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", position: "relative", minHeight: "400px" }}>
|
<div style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", position: "relative", minHeight: "400px" }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user