import * as React from 'react' ; import { Link } from "react-router-dom" ; import "./BodyChild.scss" ; const BodyChild = ( props ) => { const [ list ] = React . useState < any [ ] > ( props . tags ) ; const musicHeader = list . slice ( 0 , 4 ) . map ( ( item , index ) => { return ( < li key = { index } > { item . name } < /li>); } ) ; return ( < div className = "bodyChildHeader" > < div className = "headerLeft" > < span className = "circle" / > < /div> < Link to = "/SongList" className = "hot" > { props . name } < /Link> { list . length > 0 ? < ul > { musicHeader } < /ul> : null} < Link to = { props . to } className = "iconfont icon-youjiantou more" > 更多 < /Link> < /div>); } ; export default BodyChild ;