'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' type Props = { file: File onCancel: () => void onUploaded: (result: { uniqueIdentifier: string manifest: PluginDeclaration }) => void } const Uploading: FC = ({ file, onCancel, onUploaded, }) => { const fileName = file.name const handleUpload = async () => { await sleep(1500) onUploaded({ uniqueIdentifier: 'yeuoly/neko:0.0.1@5395654da2c0b919b3d9b946a1a0545b737004380765e5f3b8c49976d3276c87', manifest: { name: 'Notion Sync', description: 'Sync your Notion notes with Dify', } as any, }) } React.useEffect(() => { handleUpload() }, []) return ( <>
Uploading {fileName}...
{/* Action Buttons */}
) } export default React.memo(Uploading)