import cx from "classnames"; import type { HTMLAttributes, ReactNode } from "react"; import React from "react"; import { Autocomplete } from "../Autocomplete/Autocomplete"; import { Select } from "../Select/Select"; import { TextInput } from "../TextInput/TextInput"; import { Item } from "./Item"; const CLASS_ROOT = "control-group"; interface ControlShape { type: "autocomplete" | "text" | "select"; [key: string]: any; } interface GroupProps extends HTMLAttributes { control: ControlShape; addonPrefix?: ReactNode | ReactNode[]; size?: "large"; addonSuffix?: ReactNode | ReactNode[]; className?: string; /** Invalid state */ isInvalid?: boolean; } const Group: React.FC = ({ control, addonPrefix, addonSuffix, size, className, isInvalid, ...other }) => { const { type, ...controlProps } = control; const ControlElement = (props: any) => { switch (type) { case "autocomplete": return ; case "select": return