diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts index a5a81d1c5d..cff57ab694 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts @@ -3,7 +3,7 @@ import type { UmbDocumentCreateOptionsModalData, UmbDocumentCreateOptionsModalValue, } from './document-create-options-modal.token.js'; -import { html, nothing, customElement, state, ifDefined, repeat, css } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement, state, ifDefined, repeat, css, when } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; import { @@ -128,16 +128,24 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< #renderDocumentTypes() { return html` - ${this._allowedDocumentTypes.length === 0 ? html`

No allowed types

` : nothing} - ${this._allowedDocumentTypes.map( - (documentType) => html` - this.#onSelectDocumentType(documentType.unique)}> - - - `, + ${when( + this._allowedDocumentTypes.length === 0, + () => html`

No allowed types

`, + () => + repeat( + this._allowedDocumentTypes, + (documentType) => documentType.unique, + (documentType) => + html` this.#onSelectDocumentType(documentType.unique)}> + + `, + ), )}
`; }