mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
For #10562 -- This issue was introduced in https://github.com/fleetdm/fleet/pull/10377, which was a minor styling fix. Because this is a release blocker, and the styling issue is not, I am reverting the change and re-opening the other bug so we can find an alternate, non-breaking fix.
39 lines
887 B
TypeScript
39 lines
887 B
TypeScript
import React from "react";
|
|
|
|
import Button from "components/buttons/Button";
|
|
import Icon from "components/Icon";
|
|
import { IconNames } from "components/icons";
|
|
|
|
const baseClass = "file-uploader";
|
|
|
|
interface IFileUploaderProps {
|
|
icon: IconNames;
|
|
message: string;
|
|
isLoading?: boolean;
|
|
onFileUpload: (files: FileList | null) => void;
|
|
}
|
|
|
|
const FileUploader = ({
|
|
icon,
|
|
message,
|
|
isLoading = false,
|
|
onFileUpload,
|
|
}: IFileUploaderProps) => {
|
|
return (
|
|
<div className={baseClass}>
|
|
<Icon name={icon} />
|
|
<p>{message}</p>
|
|
<Button isLoading={isLoading}>
|
|
<label htmlFor="upload-profile">Upload</label>
|
|
</Button>
|
|
<input
|
|
accept=".mobileconfig,application/x-apple-aspen-config"
|
|
id="upload-profile"
|
|
type="file"
|
|
onChange={(e) => onFileUpload(e.target.files)}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FileUploader;
|