mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Add status component
This commit is contained in:
parent
97cd8aca9e
commit
f02ec6925f
7 changed files with 66 additions and 21 deletions
23
src/components/Player/Status.jsx
Normal file
23
src/components/Player/Status.jsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { h } from 'preact'
|
||||
|
||||
const INITIAL_STATUS = {
|
||||
stage: 'loading',
|
||||
details: 'Loading...'
|
||||
}
|
||||
|
||||
const fail = details => (
|
||||
<div class="status fail">
|
||||
<h1>Error</h1>
|
||||
{details.map(x => (<p>{x}</p>))}
|
||||
<hr />
|
||||
</div>
|
||||
)
|
||||
|
||||
const loading = details => (
|
||||
<div class="status loading">
|
||||
{details.map(x => (<div>{x}</div>))}
|
||||
</div>
|
||||
)
|
||||
|
||||
export default ({ stage, details }) =>
|
||||
({fail, loading})[stage](details)
|
||||
Loading…
Add table
Add a link
Reference in a new issue