mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
material icons for core types
note that this switch logic should probably be moved outside into some sort of config file
This commit is contained in:
@@ -5,13 +5,34 @@ import copy from '../../js/data/copy.json'
|
||||
|
||||
const CardSource = ({ source, language, isLoading, error }) => {
|
||||
|
||||
function renderIconText(type) {
|
||||
switch(type) {
|
||||
case 'Eyewitness Testimony':
|
||||
return 'visibility'
|
||||
case 'Government Data':
|
||||
return 'public'
|
||||
case 'Satellite Imagery':
|
||||
return 'satellite'
|
||||
case 'Second-Hand Testimony':
|
||||
return 'visibility_off'
|
||||
case 'Video':
|
||||
return 'videocam'
|
||||
case 'Photo':
|
||||
return 'photo'
|
||||
default:
|
||||
return 'help'
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="card-source">
|
||||
{isLoading
|
||||
? <Spinner/>
|
||||
: (
|
||||
<div className="source-row">
|
||||
<i className="material-icons md-36 source-icon">photo</i>
|
||||
<i className="material-icons source-icon">
|
||||
{renderIconText(source.type)}
|
||||
</i>
|
||||
<p>{source.id}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user