Files
SCM-Manager/scm-ui/ui-webapp/src/repos/sources/components/FileIcon.tsx

22 lines
422 B
TypeScript
Raw Normal View History

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