`;
}
/**
* Render the bottom slot which aggregates lists (polls, meetings, file uploads, attachments, embeds).
*
* @internal
*/
protected renderBottomSlot(): (TemplateResult | typeof nothing)[] | TemplateResult | typeof nothing {
return [this.renderLists()];
}
/**
* Render the lists section (poll options, meetings, file uploads, attachments, embeds).
*
* @internal
*/
protected renderLists(): TemplateResult | typeof nothing {
const fileMutationResults = this.mutatingFiles.result;
const hasPolls = (this.componentFeatures?.allowsFeature(Feature.Polls) && this.pollOptions.length > 0) || false;
const hasMeetings =
(this.meeting?.provider === "zoom" &&
this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.ZoomMeetings)) ||
(this.meeting?.provider === "google" &&
this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.GoogleMeet)) ||
(this.meeting?.provider === "microsoft" &&
this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.MicrosoftTeams)) ||
false;
const hasFileMutations = (fileMutationResults && fileMutationResults.length > 0) || false;
const hasAttachments = this.attachments && this.attachments.length > 0;
const hasEmbeds = (this.componentFeatures?.allowsFeature(Feature.Embeds) && this.embeds.length > 0) || false;
if (this.disabled || !(hasPolls || hasMeetings || hasFileMutations || hasAttachments || hasEmbeds)) {
return nothing;
}
return html`
${hasPolls
? html`
${this.pollOptions.map((p: PollOptionType, index: number) => {
const optionNumber = index + 1;
return html` this.handlePollOptionChange(e, index)}
@keyup=${inputConsume}
@focus=${(e: Event) => this.handlePollOptionAdd(e, index)}
/>`;
})}
`
: nothing}
${hasMeetings && this.meeting
? html`
${getMeetingTitle(this.meeting.provider)}
this.handleRemoveMeeting()}>
`
: nothing}
${hasFileMutations && fileMutationResults
? html`
${repeat(
fileMutationResults,
(mutation) => "mutation" + mutation.submittedAt,
(mutation) => {
if (mutation.context?.file) {
const file = mutation.context.file;
const fileStatus: FileStatusType = {
...mutation.context.status,
};
return html`
${file.name}
${fileStatus.text ? html`: ${fileStatus.text}` : nothing}
${fileStatus.state === "pending"
? html`
`
: nothing}
{
this.handleRemoveUpload(mutation);
}}
title=${msg("Discard", { desc: "Button action to discard" })}
>
`;
}
return nothing;
},
)}
`
: nothing}
${hasAttachments
? this.attachments.map(
(attachment) =>
html`
${attachment.name}
this.handleRemoveAttachment(attachment)}
title=${msg("Remove", { desc: "Button action to remove" })}
>
`,
)
: nothing}
${hasEmbeds
? html`
this.removeEmbed(e)}
@embed-swap=${() => this.swapEmbed()}
>
`
: nothing}
`;
}
/**
* Render the cloud files picker if cloud files feature is enabled.
*
* @internal
*/
protected renderCloudFiles(): TemplateResult | typeof nothing {
if (this.disabled) {
return nothing;
}
return html`
${this.renderTopSlot()} ${this.renderMiddleSlot()} ${this.renderBottomSlot()}
${this.renderCloudFiles()}
`;
}
}