{#if state !== "collapsed"} { if (onclose !== undefined) { onclose(); } else { state = "collapsed"; } }} on:submit={async ({ detail: { comment, embeds } }) => { try { state = "submit"; await submit(comment, Array.from(embeds.values())); } finally { state = "collapsed"; } }} /> {:else} { state = "expanded"; if (onexpand !== undefined) { onexpand(); } }}> {placeholder} {/if}