PluralKit/src/lib/system/Main.svelte

29 lines
784 B
Svelte
Raw Normal View History

2021-12-11 14:57:20 +00:00
<script lang="ts">
import { Card, CardBody } from 'sveltestrap';
import CardsHeader from '../CardsHeader.svelte';
2021-12-11 17:45:08 +00:00
import SystemBody from './Body.svelte';
import SystemPrivacy from './Privacy.svelte';
2021-12-12 06:46:57 +00:00
import Edit from './Edit.svelte';
import type Sys from '../../api/system';
2021-12-11 14:57:20 +00:00
export let user: Sys;
2021-12-11 17:41:21 +00:00
export let isPublic = true;
2021-12-12 06:46:57 +00:00
let loading: boolean;
2021-12-11 14:57:20 +00:00
2021-12-11 17:41:21 +00:00
let editMode = false;
2021-12-11 14:57:20 +00:00
</script>
2021-12-11 17:41:21 +00:00
<Card class="mb-4">
2021-12-12 06:46:57 +00:00
<CardsHeader bind:item={user} bind:loading/>
2021-12-11 14:57:20 +00:00
<CardBody style="border-left: 4px solid #{user.color}">
{#if !editMode}
2021-12-12 06:46:57 +00:00
<Body bind:user bind:editMode/>
2021-12-11 14:57:20 +00:00
{:else}
2021-12-12 06:46:57 +00:00
<Edit bind:user bind:editMode bind:loading />
2021-12-11 14:57:20 +00:00
{/if}
</CardBody>
2021-12-11 17:41:21 +00:00
</Card>
{#if !isPublic}
<SystemPrivacy bind:user={user} />
{/if}