mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
refmt CardSource
This commit is contained in:
@@ -6,24 +6,22 @@ import copy from '../../js/data/copy.json'
|
||||
const CardSource = ({ source, language, isLoading, error }) => {
|
||||
const source_lang = copy[language].cardstack.source
|
||||
|
||||
if (isLoading) {
|
||||
return <Spinner />
|
||||
}
|
||||
|
||||
function renderSource() {
|
||||
return (
|
||||
return source.error ? (
|
||||
<div><small>{source.error}</small></div>
|
||||
) : (
|
||||
<div><p>TODO: display source properly.</p></div>
|
||||
)
|
||||
}
|
||||
|
||||
function renderContent() {
|
||||
return isLoading ? <Spinner/> : renderSource()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="card-col card-cell source">
|
||||
<h4>{source_lang}: </h4>
|
||||
{source.error ? (
|
||||
<div><small>{source.error}</small></div>
|
||||
) : (
|
||||
renderSource()
|
||||
)}
|
||||
{renderContent()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user