import {FC, ReactNode, useEffect, useState} from "react"; import {View} from "@tarojs/components"; import Icon from "@/components/icon"; import CustomPageContainer from "@/components/custom-page-container/custom-page-container"; import Img from "@/components/image/image"; interface Props { height?: number | string title: string content?: string | ReactNode chevron?: boolean image?: string isProp?: boolean children?: ReactNode show?: boolean onClick?: () => void no_border?: boolean leftImage?: string } const PopPut: FC = ({title, chevron, content, image, isProp, children, show, ...opt}: Props) => { const [PageShow, setShow] = useState(false) useEffect(() => { if (PageShow) { setShow(false) } }, [show]) function click() { setShow(true) opt.onClick?.() } const style = (): string => { let css = '' if (opt.height) { css += ` height:${opt.height}px;font-size:16px` } if (opt.no_border) { css += ` border:none` } return css } return ( <> {opt.leftImage != null && } {title} {content} {!chevron && } {image && } { isProp && setShow(false)}> {children} } ) } export default PopPut