'use client' import type { FC } from 'react' import React from 'react' import type { PluginDeclaration } from '../../../types' import Card from '../../../card' import { pluginManifestToCardPluginProps } from '../../utils' import Button from '@/app/components/base/button' import { sleep } from '@/utils' import { Trans, useTranslation } from 'react-i18next' import { RiLoader2Line } from '@remixicon/react' const i18nPrefix = 'plugin.installModal' type Props = { payload: PluginDeclaration onCancel: () => void onInstalled: () => void onFailed: () => void } const Installed: FC = ({ payload, onCancel, onInstalled, onFailed, }) => { const { t } = useTranslation() const [isInstalling, setIsInstalling] = React.useState(false) const handleInstall = async () => { if (isInstalling) return setIsInstalling(true) await sleep(1500) // onInstalled() onFailed() } return ( <>

{t(`${i18nPrefix}.readyToInstall`)}

}} />

{/* Action Buttons */}
{!isInstalling && ( )}
) } export default React.memo(Installed)