import { View } from '@tarojs/components'
import { useMemo } from 'react'
import styles from './index.module.scss'

export interface colorParams {
  value?: { backgroundColor: string }|null
  show?: false|true
  onClose?: () => void
}
const Preview = ({ value, show = false, onClose }: colorParams) => {
  return (
    <>
      {show && <View className={styles.main} catch-move="true" onClick={() => onClose?.()}>
        <View className={styles.con}>
          <View className={styles.rgb} style={value!}></View>
          <View className={styles.name}>颜色</View>
        </View>
      </View>}
    </>
  )
}

export default Preview
