{#if state !== "collapsed"} { if (onclose !== undefined) { onclose(); } else { state = "collapsed"; } }} {disableAttachments} submit={async ({ comment, embeds }) => { try { state = "submit"; await submit(comment, Array.from(embeds.values())); } finally { state = "collapsed"; } }} secondarySubmit={secondarySubmit ? { caption: secondarySubmit.caption, description: secondarySubmit.description, submit: async ({ comment, embeds }) => { try { state = "submit"; await secondarySubmit.submit( comment, Array.from(embeds.values()), ); } finally { state = "collapsed"; } }, } : undefined} /> {:else} { e.preventDefault(); e.stopPropagation(); state = "expanded"; if (onexpand !== undefined) { onexpand(); } }}> {placeholder} {/if}