import { MyBetaModalFormProps, renderTextHelper } from '@/common'; import { MyModal } from '@/components/MyModal'; import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Image, Space, Typography } from 'antd'; const { Text } = Typography; export default function info(props: MyBetaModalFormProps) { // 根据类型渲染内容 const renderContent = () => { const { type, source } = props?.item || {}; if (!source || !Array.isArray(source) || source.length === 0) { return 暂无内容; } switch (type) { case 'Text': return (
{source?.[0]?.text}
); case 'Image': return ( {source.map((res: any, index: number) => ( ))} ); case 'Video': return (
{source.map((res: any, index: number) => ( ))}
); default: return 未知内容类型; } }; return ( {props?.item?.name || '-'} {props?.item?.start_time || '-'} {props?.item?.end_time || '-'} {props?.item?.sort || '-'} {props?.item?.create_at || '-'} {props?.item?.updated_at || '-'} {props?.item?.redirect_type === 'AnotherMiniProgram' && ( {props?.item?.app_id || '-'} )} {props?.item?.redirect_path || '-'}
{renderContent()}
} /> ); }