53 lines
1.2 KiB
Svelte
53 lines
1.2 KiB
Svelte
<script lang="ts">
|
|||
|
|
import type { Snippet } from 'svelte';
|
||
|
|
import type {
|
||
|
|
UserCreateRequest,
|
||
|
|
UserDeleteRequest,
|
||
|
|
UserId,
|
||
|
|
UserListRequest,
|
||
|
|
UserRole,
|
||
|
|
UserUpdateRequest
|
||
|
|
} from '../types';
|
||
|
|
import Dialog from './Dialog.svelte';
|
||
|
|
import UserManagement from './UserManagement.svelte';
|
||
|
|
|
||
|
|
let {
|
||
|
|
children,
|
||
|
|
description = '',
|
||
|
|
currentRole = 'user',
|
||
|
|
currentUserId,
|
||
|
|
onCreateUser,
|
||
|
|
onDeleteUser,
|
||
|
|
onListUsers,
|
||
|
|
onUpdateUser,
|
||
|
|
open = $bindable(false),
|
||
|
|
title = 'Settings'
|
||
|
|
}: {
|
||
|
|
children?: Snippet;
|
||
|
|
description?: string;
|
||
|
|
currentRole?: UserRole;
|
||
|
|
currentUserId?: UserId;
|
||
|
|
onCreateUser?: UserCreateRequest;
|
||
|
|
onDeleteUser?: UserDeleteRequest;
|
||
|
|
onListUsers?: UserListRequest;
|
||
|
|
onUpdateUser?: UserUpdateRequest;
|
||
|
|
open?: boolean;
|
||
|
|
title?: string;
|
||
|
|
} = $props();
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<Dialog bind:open {description} {title}>
|
||
|
|
{#if children}
|
||
|
|
{@render children()}
|
||
|
|
{:else}
|
||
|
|
<p class="sc-muted">No settings have been configured for this application yet.</p>
|
||
|
|
{/if}
|
||
|
|
<UserManagement
|
||
|
|
currentRole={currentRole}
|
||
|
|
currentUserId={currentUserId}
|
||
|
|
onCreate={onCreateUser}
|
||
|
|
onDelete={onDeleteUser}
|
||
|
|
onList={onListUsers}
|
||
|
|
onUpdate={onUpdateUser}
|
||
|
|
/>
|
||
|
|
</Dialog>
|