import { View, Image } from "@tarojs/components"
import style from './index.module.less'
import IconArrowRight from '@/images/icon-arrow-right-24.png'
interface Props {
  arrow?: boolean
  children?: JSX.Element[]|JSX.Element
  rightRenderer?: ()=> JSX.Element[]|JSX.Element
  onClick?: () => void
}
export default ({arrow = true, rightRenderer, onClick, children}:Props) => {
  const handleClick = ()=> {
    onClick && onClick()
  }
  return (
    <View className="flex w-full bg-white rounded-20 px-20 py-24" onClick={handleClick}>
      <View className="flex-1 text-16 text-black leading-24  font-medium relative">
        {children}
      </View>
      <View className="flex items-center">
        {rightRenderer && rightRenderer()}
        {arrow && <Image src={IconArrowRight} className={style.arrow} mode="widthFix"></Image>}
      </View>
    </View>
  )
}