You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/frontend/src/components/bazarr/HistoryIcon.tsx

55 lines
1.0 KiB

import {
faClock,
faCloudUploadAlt,
faDownload,
faRecycle,
faTrash,
faUser,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { FunctionComponent } from "react";
enum HistoryAction {
Delete = 0,
Download,
Manual,
Upgrade,
Upload,
Sync,
}
const HistoryIcon: FunctionComponent<{
action: number;
title?: string;
}> = ({ action, title }) => {
let icon = null;
switch (action) {
case HistoryAction.Delete:
icon = faTrash;
break;
case HistoryAction.Download:
icon = faDownload;
break;
case HistoryAction.Manual:
icon = faUser;
break;
case HistoryAction.Sync:
icon = faClock;
break;
case HistoryAction.Upgrade:
icon = faRecycle;
break;
case HistoryAction.Upload:
icon = faCloudUploadAlt;
break;
}
if (icon) {
return <FontAwesomeIcon title={title} icon={icon}></FontAwesomeIcon>;
} else {
return null;
}
};
export default HistoryIcon;