/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import React from "react"; import Spinner from "./Spinner"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFile } from "@fortawesome/free-solid-svg-icons"; import "./FileInput.css"; import { useTranslation } from "react-i18next"; interface Props { id: string; name: string; label: string; register?: Function; required?: boolean; disabled?: boolean; fileName?: string; staticFileName?: string; hint?: string | React.ReactNode; accept?: string; errors?: any; loading?: boolean; onFileProcessed?: Function; } function FileInput(props: Props) { const { t } = useTranslation(); let content = (
); if (props.loading) { content =