11"use client" ;
22
33import React , { useState , useEffect , useRef } from "react" ;
4+ import { useRouter } from "next/navigation" ;
45import { motion } from "framer-motion" ;
56import { useTranslation } from "react-i18next" ;
67import { ShoppingBag , Search , RefreshCw , ChevronLeft , ChevronRight } from "lucide-react" ;
@@ -27,6 +28,7 @@ import "./MarketContent.css";
2728 * Browse and download pre-built agents from the marketplace
2829 */
2930export default function MarketContent ( ) {
31+ const router = useRouter ( ) ;
3032 const { t, i18n } = useTranslation ( "common" ) ;
3133 const { message } = App . useApp ( ) ;
3234 const isZh = i18n . language === "zh" || i18n . language === "zh-CN" ;
@@ -250,15 +252,28 @@ export default function MarketContent() {
250252 } ;
251253
252254 /**
253- * Handle install complete
255+ * Handle install complete - Shows success message with navigation to agent space
254256 */
255257 const handleInstallComplete = ( ) => {
256258 setInstallModalVisible ( false ) ;
257259 setInstallAgent ( null ) ;
258- // Optionally reload agents or show success message
259- message . success (
260- t ( "market.install.success" , "Agent installed successfully!" )
261- ) ;
260+
261+ // Show success message with clickable link to agent space
262+ message . success ( {
263+ content : (
264+ < span >
265+ { t ( "market.install.success.viewSpace.prefix" ) }
266+ < button
267+ onClick = { ( ) => router . push ( "/space" ) }
268+ className = "text-blue-600 dark:text-blue-400 font-bold hover:text-blue-700 dark:hover:text-blue-300 cursor-pointer transition-colors"
269+ >
270+ { t ( "market.install.success.viewSpace.link" ) }
271+ </ button >
272+ { t ( "market.install.success.viewSpace.suffix" ) }
273+ </ span >
274+ ) ,
275+ duration : 4 ,
276+ } ) ;
262277 } ;
263278
264279 /**
0 commit comments