'use client' import type { FC } from 'react' import React from 'react' import { RiLoader2Line } from '@remixicon/react' import Card from '../../../card' import type { PluginDeclaration } from '../../../types' import Button from '@/app/components/base/button' import { sleep } from '@/utils' import { useTranslation } from 'react-i18next' import { toolNotionManifest } from '../../../card/card-mock' const i18nPrefix = 'plugin.installModal' type Props = { file: File onCancel: () => void onUploaded: (result: { uniqueIdentifier: string manifest: PluginDeclaration }) => void } const Uploading: FC = ({ file, onCancel, onUploaded, }) => { const { t } = useTranslation() const fileName = file.name const handleUpload = async () => { await sleep(3000) onUploaded({ uniqueIdentifier: 'yeuoly/neko:0.0.1@5395654da2c0b919b3d9b946a1a0545b737004380765e5f3b8c49976d3276c87', manifest: toolNotionManifest, }) } React.useEffect(() => { handleUpload() }, []) return ( <>
{t(`${i18nPrefix}.uploadingPackage`, { packageName: fileName, })}
{/* Action Buttons */}
) } export default React.memo(Uploading)