import React, { useContext, useMemo } from 'react';
import { ConfigContext } from '../wau-config-provider';
import { jsx as _jsx } from "react/jsx-runtime";
const DotPosition = props => {
  const {
    getPrefixCls
  } = useContext(ConfigContext);
  const cName = useMemo(getPrefixCls, [getPrefixCls]);
  const locationList = ['northwest', 'north', 'northeast', 'west', 'center', 'east', 'southwest', 'south', 'southeast'];
  const {
    value: selectedDot,
    onChange: changePosition,
    disabled
  } = props;
  return /*#__PURE__*/_jsx("div", {
    className: `${cName}-location-wrap`,
    children: locationList.map(item => {
      return /*#__PURE__*/_jsx("div", {
        className: `${cName}-location-cell`,
        style: {
          background: selectedDot === item ? '#CDE2FF' : '',
          cursor: disabled ? 'not-allowed' : '',
          opacity: disabled ? 0.5 : ''
        },
        onClick: () => !disabled && (changePosition === null || changePosition === void 0 ? void 0 : changePosition(item)),
        children: selectedDot === item ? /*#__PURE__*/_jsx("span", {
          className: `${cName}-cell-dot`
        }) : ''
      }, item);
    })
  });
};
export default DotPosition;