MCPcopy
hub / github.com/callumalpass/tasknotes / renderExistingReminders

Method renderExistingReminders

src/modals/ReminderModal.ts:194–256  ·  view source on GitHub ↗
(container: HTMLElement)

Source from the content-addressed store, hash-verified

192 }
193
194 private renderExistingReminders(container: HTMLElement): void {
195 const section = container.createDiv({ cls: "reminder-modal__section" });
196
197 const sectionHeader = section.createDiv({ cls: "reminder-modal__section-header" });
198 sectionHeader.createEl("h3", { text: "Current reminders" });
199
200 if (this.reminders.length > 0) {
201 sectionHeader.createSpan({
202 cls: "reminder-modal__reminder-count",
203 text: `(${this.reminders.length})`,
204 });
205 }
206
207 if (this.reminders.length === 0) {
208 const emptyState = section.createDiv({ cls: "reminder-modal__empty-state" });
209 setIcon(emptyState.createDiv({ cls: "reminder-modal__empty-icon" }), "bell-off");
210 emptyState.createEl("div", {
211 cls: "reminder-modal__empty-text",
212 text: "No reminders set",
213 });
214 return;
215 }
216
217 const reminderList = section.createDiv({ cls: "reminder-modal__reminder-list" });
218
219 this.reminders.forEach((reminder, index) => {
220 const reminderCard = reminderList.createDiv({ cls: "reminder-modal__reminder-card" });
221
222 // Reminder type icon
223 const iconContainer = reminderCard.createDiv({ cls: "reminder-modal__reminder-icon" });
224 const iconName = reminder.type === "absolute" ? "calendar-clock" : "timer";
225 setIcon(iconContainer, iconName);
226
227 // Main content area
228 const content = reminderCard.createDiv({ cls: "reminder-modal__reminder-content" });
229
230 // Primary info (timing with time for absolute reminders)
231 const primaryInfo = content.createDiv({ cls: "reminder-modal__reminder-primary" });
232 primaryInfo.textContent = this.formatReminderDisplayText(reminder);
233
234 // Custom description (if any)
235 if (reminder.description) {
236 const description = content.createDiv({
237 cls: "reminder-modal__reminder-description",
238 });
239 description.textContent = `"${reminder.description}"`;
240 }
241
242 // Actions area - only remove button
243 const actions = reminderCard.createDiv({ cls: "reminder-modal__reminder-actions" });
244
245 // Remove button with Obsidian tooltip
246 const removeBtn = actions.createEl("button", {
247 cls: "reminder-modal__action-btn reminder-modal__remove-btn",
248 });
249 setIcon(removeBtn, "trash-2");
250 setTooltip(removeBtn, "Delete this reminder");
251 removeBtn.onclick = async (e) => {

Callers 2

Calls 4

removeReminderMethod · 0.95
setIconFunction · 0.90
setTooltipFunction · 0.90

Tested by

no test coverage detected