import React from 'react' import { View } from '@tarojs/components' import type { ColorProps } from '@lx-react-materiel/shared' import { color, transformValue } from '@lx-react-materiel/shared' interface LxSemiCircleProps { size?: number backgroundColor?: Pick['backgroundColor'] type?: 'left' | 'right' // 左半圆,右半圆 } /** * 内凹分割组件 * @param props * @constructor */ export function LxSemiCircle (props: LxSemiCircleProps) { const { size = 30, type = 'left' } = props const sizesValue = transformValue(size) const style = { width: sizesValue, height: sizesValue, ...color(props) } const topStyle = { ...style, ...(type === 'left' && { borderTopLeftRadius: sizesValue }), ...(type === 'right' && { borderTopRightRadius: sizesValue }) } const bottomStyle = { ...style, ...(type === 'left' && { borderBottomLeftRadius: sizesValue }), ...(type === 'right' && { borderBottomRightRadius: sizesValue }) } return ( ) } export default LxSemiCircle