import { useState, useEffect } from "react";
import withHelperText from "../../../hoc/withHelperText";
import withValidations from "../../../hoc/withValidations";
import ListViewWidget, { ListViewProps } from "./ListViewWidget";

const ListContainer = (props: ListViewProps) => {
  const [listViewProps, setListViewProps] = useState<ListViewProps>({} as ListViewProps);
  useEffect(() => {
    setListViewProps({ ...props });
  }, [props]);
  return <ListViewWidget {...listViewProps} />;
};
export default withValidations(withHelperText(ListContainer));
