import React, {useEffect, useState} from 'react'; import Image from "next/image"; import {EventBus} from "@/utils/eventBus"; import {getFormattedDate, modelIcon} from "@/utils/utils"; import AddModelMarketPlace from "./AddModelMarketPlace"; export default function ModelTemplate({env, template, getModels, sendModelData}){ const [isInstalled, setIsInstalled] = useState(false); function handleBackClick() { EventBus.emit('goToMarketplace', {}); } function handleInstallClick() { if (window.location.href.toLowerCase().includes('marketplace')) { if (env === 'PROD') { window.open(`https://app.superagi.com/`, '_self'); } else { window.location.href = '/'; } } else { setIsInstalled(true) } } return (