import { View } from '@tarojs/components' import './status_indicator.scss' import { rpxToPx } from '@/utils/tools' import { MainColorType } from '@/context/themes/color' export enum StatusType { normal = 'normal', ing = 'ing', img = 'img', console = 'console', big = 'big' } export default function StatusIndicator(props: { type: StatusType, color: string, text?: string, children?: any, fontColor?: string, fontSize?: number defaultSpace?: boolean, space?: number }) { function indicator() { switch (props.type) { case StatusType.normal: return case StatusType.ing: return case StatusType.img: return { props.children } case StatusType.console: return { props.children } case StatusType.big: return { props.children } } return } function marginLeft() { if (props.type == StatusType.console || props.type == StatusType.big) return rpxToPx(24) if (props.defaultSpace) return rpxToPx(12) if (props.space) return props.space return rpxToPx(6) } return { indicator() } { props.text && {props.text} } }