import { ChevronDown, ChevronRight } from 'lucide-react'; import { AnimatePresence, motion } from 'motion/react'; import type { AssetSummarySectionProps } from './types'; export function AssetSummaryMobileCards({ processedData, theme, expandedAssetTypes, toggleAssetType, expandedModels, toggleModel, setVehicleSelection: setShowPlateNumbers, }: AssetSummarySectionProps) { return (
{processedData.map((typeGroup) => (
toggleAssetType(typeGroup.type)} >
{expandedAssetTypes.has(typeGroup.type) ? : } {typeGroup.type}
资产 {typeGroup.totalAssets} 库存 {typeGroup.totalInventory} 异动 {typeGroup.totalAbnormal} 运营 {typeGroup.totalOperating}
{expandedAssetTypes.has(typeGroup.type) && ( {typeGroup.models.map((model) => (
toggleModel(model.model)} >
{expandedModels.has(model.model) ? : } {model.model}
{ e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', source: 'asset', title: model.model }); }}>资产 {model.total} { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Inventory', source: 'asset', title: `${model.model} - 库存` }); }}>库存 {model.inventory} { e.stopPropagation(); setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Operating', source: 'asset', title: `${model.model} - 在运营` }); }}>运营 {model.operating}
{expandedModels.has(model.model) && (
setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Inventory', source: 'asset', title: `${model.model} - 库存` })}> 总库存 {model.inventory}
setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Pending', source: 'asset', title: `${model.model} - 待交车` })}> 待交车 {model.pending}
{['嘉兴', '广东', '北京', '新疆', '其他'].map(reg => (
{reg === '嘉兴' ? '浙' : reg === '广东' ? '粤' : reg === '北京' ? '京' : reg === '新疆' ? '新' : '其'}
{model.inventoryRegions[reg] > 0 ? ( ) : (
-
)}
))}
setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Delivered', source: 'asset', title: `${model.model} - 本周交车` })}> 本周已交车 {model.weeklyDelivered}
setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Returned', source: 'asset', title: `${model.model} - 本周还车` })}> 已还车 {model.weeklyReturned}
setShowPlateNumbers({ batch: 'All', model: model.model, location: 'All', category: 'Replaced', source: 'asset', title: `${model.model} - 本周替换` })}> 已替换 {model.weeklyReplaced}
)}
))}
)}
))}
); }