import { useContext } from "react";
import type { ReactElement } from "react";
import { Locale } from "../../locale";
import { FilesUploaderCtx } from "../context/index";

/**
 * Компонент вывода текста загрузчика
 * @returns
 * */
export const FilesUploaderText = (): ReactElement => {

  const { getCN, isError, isMultiple } = useContext(FilesUploaderCtx);

  return (
    <div className={getCN("text")}>
      <Locale code={`filesUploader.${isError ? "errorText" : "actionText"}`} options={{ isMultiple }} />
    </div>
  );
};
