{#if edit} {$i18n.t('Edit Channel')} {:else} {$i18n.t('Create Channel')} {/if}
{ submitHandler(); }} > {#if !edit}
{$i18n.t('Channel Type')}
{/if}
{#if type === ''} {$i18n.t('Discussion channel where access is based on groups and permissions')} {:else if type === 'group'} {$i18n.t('Collaboration channel where people join as members')} {:else if type === 'dm'} {$i18n.t('Private conversation between selected users')} {/if}
{$i18n.t('Channel Name')} {#if type === 'dm'}{$i18n.t('Optional')}{/if}
{#if type !== 'dm'}
{#if type === ''} { if (edit && channel?.id) { try { await updateChannelAccessGrants( localStorage.token, channel.id, accessGrants ); channel.access_grants = structuredClone(accessGrants); toast.success($i18n.t('Saved')); onUpdate(); } catch (error) { accessGrants = structuredClone(channel.access_grants ?? []); toast.error(`${error}`); } } }} /> {:else if type === 'group'} { isPrivate = value === 'private'; }} /> {/if}
{/if} {#if ['dm'].includes(type)}
{/if} {#if edit}
{$i18n.t('Webhooks')}
{/if}
{#if edit} {/if}
{ deleteHandler(); }} />