/**
 * V21 Select 选择器
 * 封装 Ant Design Select，应用 V21 设计系统样式
 */
import React from "react";
import { Select as AntSelect } from "antd";
import type { SelectProps as AntSelectProps } from "antd";
import classNames from "classnames";
import "./ui.css";

export interface SelectProps extends AntSelectProps {
  /** 自定义弹出层类名 */
  dropdownClassName?: string;
}

const Select: React.FC<SelectProps> = ({
  className,
  dropdownClassName,
  ...rest
}) => {
  const v21Class = classNames("xx-select", className);
  const v21DropdownClass = classNames("xx-select-dropdown", dropdownClassName);
  return (
    <AntSelect
      className={v21Class}
      popupClassName={v21DropdownClass}
      {...rest}
    />
  );
};

export default Select;
