import FactoryRenderer from "../../../../Renderer";

export type GroupByViewProps = {
  disabled: boolean;
  onPopupToggle: () => void;
  hasAppliedFilter?: boolean;
};

const GroupByView = (props: GroupByViewProps) => {
  return (
    <FactoryRenderer
      onClick={props.onPopupToggle}
      title="Group By"
      rootStyle={{ className: "tmpl-groupby" }}
      widgetStyle={{ className: `qo-btn qo-btn-default qo-btn-md tmpl-button ${props.hasAppliedFilter ? "tmpl-filter-applied" : ""}` }}
      uiElementType="WIDGET"
      widgetType="BUTTON"
      disabled={props.disabled}
    />
  );
};
export default GroupByView;
