fleet/frontend/pages/ManageControlsPage/components/FileUploader/FileUploader.tsx
Gabriel Hernandez b8fa08b53c
implement mdm scripts page UI (#10092)
relates to #9831

Implements the mdm mac OS scripts UI. This is just the UI atm and is not
accessible in the application at the moment.
2023-03-06 15:03:48 +00:00

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;