import type { CSSProperties, ReactNode } from 'react' import { View, Text } from '@tarojs/components' import { trackClick } from '../utils/track' const isH5 = process.env.TARO_ENV === 'h5' type BoxProps = { className?: string id?: string children?: ReactNode onClick?: () => void html?: string style?: CSSProperties 'aria-hidden'?: boolean 'aria-label'?: string 'data-theme'?: string /** 设了则点击时自动 btn_click 埋点 */ trackLabel?: string } /** H5 uses native div (taro-view-core defaults to inline and breaks grid/absolute). */ export function H5Box({ className, id, children, onClick, html, style, 'aria-hidden': ariaHidden, 'aria-label': ariaLabel, 'data-theme': dataTheme, trackLabel, }: BoxProps) { const handleClick = onClick ? () => { if (trackLabel) trackClick(trackLabel) onClick() } : trackLabel ? () => trackClick(trackLabel) : undefined if (isH5) { return (