mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
21
scm-ui/ui-webapp/src/repos/sources/components/FileIcon.tsx
Normal file
21
scm-ui/ui-webapp/src/repos/sources/components/FileIcon.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import { File } from '@scm-manager/ui-types';
|
||||
|
||||
type Props = {
|
||||
file: File;
|
||||
};
|
||||
|
||||
class FileIcon extends React.Component<Props> {
|
||||
render() {
|
||||
const { file } = this.props;
|
||||
let icon = 'file';
|
||||
if (file.subRepository) {
|
||||
icon = 'folder-plus';
|
||||
} else if (file.directory) {
|
||||
icon = 'folder';
|
||||
}
|
||||
return <i className={`fa fa-${icon}`} />;
|
||||
}
|
||||
}
|
||||
|
||||
export default FileIcon;
|
||||
Reference in New Issue
Block a user