MCPcopy
hub / github.com/github/awesome-copilot / showToast

Function showToast

website/src/scripts/utils.ts:323–338  ·  view source on GitHub ↗
(
  message: string,
  type: "success" | "error" = "success"
)

Source from the content-addressed store, hash-verified

321 * Show a toast notification
322 */
323export function showToast(
324 message: string,
325 type: "success" | "error" = "success"
326): void {
327 const existing = document.querySelector(".toast");
328 if (existing) existing.remove();
329
330 const toast = document.createElement("div");
331 toast.className = `toast ${type}`;
332 toast.textContent = message;
333 document.body.appendChild(toast);
334
335 setTimeout(() => {
336 toast.remove();
337 }, 3000);
338}
339
340/**
341 * Debounce function for search input

Callers 8

setupModalFunction · 0.90
copyInstallCommandFunction · 0.90
downloadSkillFunction · 0.90
setupActionHandlersFunction · 0.90
downloadHookFunction · 0.90
setupActionHandlersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected