<script>
    import { user }         from '../../user.svelte.js';
    import { t }            from '../../translations.svelte.js';

    import LoginServiceList from './LoginServices.svelte';
    import Profile          from './Profile.svelte';
    import UserList         from './List.svelte';

    let params   = new URLSearchParams(location.search);
    let redirect = params.get('returnTo');
    if (redirect && user.name) location.href = redirect;
</script>

<svelte:head>
    <title>Umbrella – {t('user')}: {user?.name}</title>
</svelte:head>

<h1>{t('user_module')}</h1>

<Profile />

{#if user.permissions.includes('LIST_USERS')}
<UserList />
{/if}
<LoginServiceList />

