| 1 | /** |
| 2 | * 发布弹框相关的模态框组件集合 |
| 3 | * 包含抖音扫码、发布详情等弹窗 |
| 4 | */ |
| 5 | |
| 6 | import { memo } from 'react' |
| 7 | import { PublishDetailModal } from '@/components/Plugin' |
| 8 | import { DouyinQRCodeModal } from '@/components/PublishDialog/compoents/DouyinQRCodeModal' |
| 9 | |
| 10 | interface PublishModalsProps { |
| 11 | // 抖音扫码弹窗 |
| 12 | douyinQRCodeVisible: boolean |
| 13 | setDouyinQRCodeVisible: (visible: boolean) => void |
| 14 | douyinPermalink: string |
| 15 | // 发布详情弹框 |
| 16 | publishDetailVisible: boolean |
| 17 | onPublishDetailClose: () => void |
| 18 | currentPublishTaskId: string | undefined |
| 19 | // 发布完成后是否自动关闭弹框 |
| 20 | autoCloseOnComplete?: boolean |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * 发布弹框相关的模态框组件集合 |
| 25 | */ |
| 26 | export const PublishModals = memo( |
| 27 | ({ |
| 28 | douyinQRCodeVisible, |
| 29 | setDouyinQRCodeVisible, |
| 30 | douyinPermalink, |
| 31 | publishDetailVisible, |
| 32 | onPublishDetailClose, |
| 33 | currentPublishTaskId, |
| 34 | autoCloseOnComplete, |
| 35 | }: PublishModalsProps) => { |
| 36 | return ( |
| 37 | <> |
| 38 | |
| 39 | {/* 抖音扫码发布弹窗 */} |
| 40 | {douyinQRCodeVisible && ( |
| 41 | <DouyinQRCodeModal |
| 42 | open={douyinQRCodeVisible} |
| 43 | permalink={douyinPermalink} |
| 44 | onClose={() => setDouyinQRCodeVisible(false)} |
| 45 | /> |
| 46 | )} |
| 47 | |
| 48 | {/* 发布详情弹框 - 显示插件发布进度 */} |
| 49 | {publishDetailVisible && ( |
| 50 | <PublishDetailModal |
| 51 | visible={publishDetailVisible} |
| 52 | onClose={onPublishDetailClose} |
| 53 | taskId={currentPublishTaskId} |
| 54 | autoCloseOnComplete={autoCloseOnComplete} |
| 55 | /> |
| 56 | )} |
| 57 | </> |
| 58 | ) |
| 59 | }, |
| 60 | ) |
| 61 | |
| 62 | PublishModals.displayName = 'PublishModals' |
| 63 | |
| 64 | export default PublishModals |
| 65 |