2019-10-20 18:02:52 +02:00
|
|
|
import React from "react";
|
|
|
|
|
import { File } from "@scm-manager/ui-types";
|
2018-09-27 16:32:37 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2019-10-19 16:38:07 +02:00
|
|
|
file: File;
|
2018-09-27 16:32:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FileIcon extends React.Component<Props> {
|
|
|
|
|
render() {
|
|
|
|
|
const { file } = this.props;
|
2019-10-20 18:02:52 +02:00
|
|
|
let icon = "file";
|
2018-10-24 10:34:14 +02:00
|
|
|
if (file.subRepository) {
|
2019-10-20 18:02:52 +02:00
|
|
|
icon = "folder-plus";
|
2018-10-24 10:34:14 +02:00
|
|
|
} else if (file.directory) {
|
2019-10-20 18:02:52 +02:00
|
|
|
icon = "folder";
|
2018-09-27 16:32:37 +02:00
|
|
|
}
|
|
|
|
|
return <i className={`fa fa-${icon}`} />;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default FileIcon;
|