import { useState, useEffect } from "react";
import withHelperText from "../../../hoc/withHelperText";
import withLabel from "../../../hoc/withLabel";
import LinkWidget, { LinkProps } from "./LinkWidget";

const LinkContainer = (props: LinkProps) => {
  const [linkProps, setLinkProps] = useState<LinkProps>({} as LinkProps);
  useEffect(() => {
    setLinkProps({ ...props });
  }, [props]);
  return <LinkWidget {...linkProps} />;
};
export default withHelperText(withLabel(LinkContainer));
