export function loadItem(data, isDel){
data.map((item, i) => {
let itemData = `${item.date}${item.action}${item.subject}${item.book}${item.pages}${(item.des ? ('(' + item.des + ')') : item.des)}`
if (!isDel) {
if (item.del === 'Del') return
return (
<li className="fs-4">{itemData}</li>
)
} else {
if (item.del !== 'Del') {
return (
<li className="fs-4">{itemData}
<i className={'bi bi-x-circle-fill mx-3 text-danger'}
onClick={() => {
del(setDelState, i, look)
}}></i>
</li>
)
} else {
return (
<li className="fs-4">{itemData}
<i className={'bi bi-check mx-3 bg-success text-white rounded'}
onClick={() => {
rep(setRepState, i, look);
}}></i>
</li>
)
}
}
})
}
如果我要讓data.map
return出去的jsx也return出loadItem function要怎麼辦?