26 lines
586 B
Svelte
26 lines
586 B
Svelte
|
|
<script>
|
||
|
|
import Switch from "../../common/Switch.svelte";
|
||
|
|
|
||
|
|
export let status = "draft";
|
||
|
|
export let record;
|
||
|
|
function updateStatus(e) {
|
||
|
|
|
||
|
|
if(e.target.checked){
|
||
|
|
status = "published";
|
||
|
|
}else{
|
||
|
|
status = "draft";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
|
||
|
|
{#if record.status !== "trashed"}
|
||
|
|
<Switch value="published" on:change={updateStatus} checked={record.status === "published"}></Switch>
|
||
|
|
{/if}
|
||
|
|
{#if record.status === "published"}
|
||
|
|
Published
|
||
|
|
{:else if record.status === "draft"}
|
||
|
|
Draft
|
||
|
|
{:else if record.status === "trashed"}
|
||
|
|
Trashed
|
||
|
|
{/if}
|