import { View } from "@tarojs/components"
import IconArrowRight24 from "@/components/icon/IconArrowRight24";
interface IProps {
  arrow?: boolean
  underline?: boolean
  children?: JSX.Element[]|JSX.Element|string
  rightRenderer?: ()=> JSX.Element[]|JSX.Element
  onClick?: () => void
}
export default ({underline=false, arrow=false, rightRenderer, onClick, children}: IProps) => {
  const handleClick = ()=> {
    onClick && onClick()
  }
  return (
    <View
      className={`flex items-center ${underline ? 'border-bottom1-gray': ''}`}
      onClick={handleClick}
    >
      <View className="text-14 py-18 font-medium leading-22 flex-1 shrink-0 flex items-center">{children}</View>
      {rightRenderer && rightRenderer()}
      {arrow && <View className="flex-center"><IconArrowRight24/></View>}
    </View>
  )
}
