mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
feature: create Svelte component for showing status UI
This commit is contained in:
34
lib/frontend/components/Status.svelte
Normal file
34
lib/frontend/components/Status.svelte
Normal file
@ -0,0 +1,34 @@
|
||||
<style>
|
||||
#status {
|
||||
flex: 1;
|
||||
height: 1rem;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.status-item {
|
||||
min-width: 200px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { requestStore } from '../stores'
|
||||
|
||||
$: error = ($requestStore && $requestStore.error) ? $requestStore.error : null
|
||||
$: pendingRequest = Boolean($requestStore && !$requestStore.error)
|
||||
</script>
|
||||
|
||||
<div id='status'>
|
||||
{#if error}
|
||||
<div class='status-item'>
|
||||
{error.toString()}
|
||||
</div>
|
||||
{/if}
|
||||
{#if pendingRequest}
|
||||
<div class='status-item'>
|
||||
Fetching event {$requestStore.url}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
Reference in New Issue
Block a user