{
  "name": "promise-toast",
  "type": "registry:component",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "type": "registry:component",
      "content": "\"use client\";\n\n/**\n * @author: @kokonutui\n * @description: Promise Toast\n * @version: 1.1.0\n * @date: 2026-11-08\n * @license: MIT\n * @website: https://kokonutui.com\n * @github: https://github.com/kokonut-labs/kokonutui\n */\n\nimport { Download, Globe, UserPlus, X } from \"lucide-react\";\nimport {\n  AnimatePresence,\n  animate,\n  MotionConfig,\n  type MotionValue,\n  motion,\n  useMotionValue,\n  useTransform,\n} from \"motion/react\";\nimport {\n  type ReactNode,\n  useCallback,\n  useEffect,\n  useRef,\n  useState,\n} from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ntype Status = \"loading\" | \"success\" | \"error\";\n\n/** A title, or a title and a second line. */\nexport type ToastLines = string | [string, string];\n\n/** Counted work, shown as \"Building 12 of 24 pages\" with a filling edge. */\nexport interface ToastCount {\n  total: number;\n  unit: string;\n  verb: string;\n}\n\nexport interface ToastOptions<T> {\n  /** The title while it works. */\n  loading: string;\n  /** A second line while it works, e.g. who the invite is going to. */\n  waiting?: string;\n  /** Counted work. The task reports how far it is with `report(done)`. */\n  count?: ToastCount;\n  /** What it says when the task resolves, from what it resolved with. */\n  success: ToastLines | ((value: T) => ToastLines);\n  /** What it says when the task throws. Retry runs the task again. */\n  error: ToastLines | ((error: unknown) => ToastLines);\n  /** Offers Undo once it lands, running this. */\n  undo?: {\n    run: () => Promise<unknown>;\n    loading?: ToastLines;\n    success?: ToastLines;\n  };\n}\n\n/** The work behind a toast. `report` moves a counted toast along. */\nexport type ToastTask<T> = (report: (done: number) => void) => Promise<T>;\n\ninterface ToastState {\n  id: number;\n  status: Status;\n  title: string;\n  body: string;\n  /** How many times the task has run. */\n  attempt: number;\n  /** Counted work done so far, while a counted task runs. */\n  done?: number;\n  undone?: boolean;\n  task: ToastTask<unknown>;\n  options: ToastOptions<unknown>;\n}\n\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const;\nconst STACK = { type: \"spring\", stiffness: 380, damping: 34 } as const;\nconst TOAST_H = 64;\nconst GAP = 8;\nconst VISIBLE = 3;\nconst WORK_MS = 1800;\nconst STAY_MS = 5000;\n\nconst split = (lines: ToastLines): [string, string] =>\n  typeof lines === \"string\" ? [lines, \"\"] : lines;\n\nfunction linesFor<V>(\n  lines: ToastLines | ((value: V) => ToastLines),\n  value: V\n): [string, string] {\n  return split(typeof lines === \"function\" ? lines(value) : lines);\n}\n\n/**\n * The toasts and what to do with them. `show` takes the work as a function,\n * so Retry can run it again, and returns the toast's id.\n */\nexport function usePromiseToast() {\n  const [toasts, setToasts] = useState<ToastState[]>([]);\n  const nextId = useRef(1);\n\n  const update = useCallback(\n    (id: number, patch: Partial<ToastState>) =>\n      setToasts((all) =>\n        all.map((t) => (t.id === id ? { ...t, ...patch } : t))\n      ),\n    []\n  );\n\n  const dismiss = useCallback(\n    (id: number) => setToasts((all) => all.filter((t) => t.id !== id)),\n    []\n  );\n\n  const settle = useCallback(\n    (id: number, task: ToastTask<unknown>, options: ToastOptions<unknown>) => {\n      task((done) => update(id, { done })).then(\n        (value) => {\n          const [title, body] = linesFor(options.success, value);\n          update(id, { status: \"success\", title, body, done: undefined });\n        },\n        (error: unknown) => {\n          const [title, body] = linesFor(options.error, error);\n          update(id, { status: \"error\", title, body, done: undefined });\n        }\n      );\n    },\n    [update]\n  );\n\n  const show = useCallback(\n    <T,>(task: ToastTask<T>, options: ToastOptions<T>) => {\n      const id = nextId.current++;\n      const state: ToastState = {\n        id,\n        status: \"loading\",\n        title: options.loading,\n        body: options.waiting ?? \"\",\n        attempt: 1,\n        task: task as ToastTask<unknown>,\n        options: options as ToastOptions<unknown>,\n      };\n      setToasts((all) => [...all, state]);\n      settle(id, state.task, state.options);\n      return id;\n    },\n    [settle]\n  );\n\n  const retry = useCallback(\n    (toast: ToastState) => {\n      update(toast.id, {\n        status: \"loading\",\n        title: \"Trying again\",\n        body: toast.options.waiting ?? \"\",\n        attempt: toast.attempt + 1,\n        done: undefined,\n      });\n      settle(toast.id, toast.task, toast.options);\n    },\n    [settle, update]\n  );\n\n  const undo = useCallback(\n    (toast: ToastState) => {\n      const back = toast.options.undo;\n      if (!back) {\n        return;\n      }\n      const [title, body] = split(back.loading ?? \"Reverting\");\n      update(toast.id, { status: \"loading\", title, body, undone: true });\n      back.run().then(\n        () => {\n          const [doneTitle, doneBody] = split(back.success ?? \"Reverted\");\n          update(toast.id, {\n            status: \"success\",\n            title: doneTitle,\n            body: doneBody,\n          });\n        },\n        (error: unknown) => {\n          const [failTitle, failBody] = linesFor(toast.options.error, error);\n          update(toast.id, {\n            status: \"error\",\n            title: failTitle,\n            body: failBody,\n          });\n        }\n      );\n    },\n    [update]\n  );\n\n  return { toasts, show, dismiss, retry, undo };\n}\n\nexport type PromiseToaster = ReturnType<typeof usePromiseToast>;\n\n/**\n * Where the toasts land: stacked when idle, fanned out while the pointer or\n * focus is on it. Put it once, near the bottom of your layout.\n */\nexport function Toaster({\n  toaster,\n  className,\n}: {\n  toaster: PromiseToaster;\n  className?: string;\n}) {\n  const { toasts, dismiss, retry, undo } = toaster;\n  const [expanded, setExpanded] = useState(false);\n  const [tabHidden, setTabHidden] = useState(false);\n\n  useEffect(() => {\n    // Timers stop while the tab is in the background, so nothing is missed.\n    const onVisibility = () => setTabHidden(document.hidden);\n    document.addEventListener(\"visibilitychange\", onVisibility);\n    return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n  }, []);\n\n  // Newest first, so index 0 sits in front.\n  const ordered = [...toasts].reverse();\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      {/* biome-ignore lint/a11y/noNoninteractiveElementInteractions: hover and focus only fan the stack out; every action is a button inside it. */}\n      <section\n        aria-label=\"Notifications\"\n        aria-live=\"polite\"\n        className={cn(\"relative h-[232px]\", className)}\n        data-state={\n          toasts.some((t) => t.status === \"loading\") ? \"busy\" : \"idle\"\n        }\n        onBlur={(event) => {\n          if (!event.currentTarget.contains(event.relatedTarget)) {\n            setExpanded(false);\n          }\n        }}\n        onFocus={() => setExpanded(true)}\n        onPointerEnter={(event) => {\n          if (event.pointerType === \"mouse\") {\n            setExpanded(true);\n          }\n        }}\n        onPointerLeave={() => setExpanded(false)}\n      >\n        <ol className=\"absolute inset-x-0 bottom-0\">\n          <AnimatePresence initial={false}>\n            {ordered.map((toast, index) => (\n              <ToastItem\n                expanded={expanded}\n                index={index}\n                key={toast.id}\n                onDismiss={() => dismiss(toast.id)}\n                onRetry={() => retry(toast)}\n                onUndo={() => undo(toast)}\n                paused={expanded || tabHidden}\n                toast={toast}\n              />\n            ))}\n          </AnimatePresence>\n        </ol>\n      </section>\n    </MotionConfig>\n  );\n}\n\nconst wait = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\n/** Demo work that counts up to `total` over `ms`, easing out. */\nconst countTo =\n  (total: number, ms: number): ToastTask<void> =>\n  async (report) => {\n    const steps = 24;\n    for (let i = 1; i <= steps; i++) {\n      await wait(ms / steps);\n      report(Math.round(total * (1 - (1 - i / steps) ** 2)));\n    }\n  };\n\ninterface DemoTask {\n  label: string;\n  icon: ReactNode;\n  note?: string;\n  run: (toaster: PromiseToaster) => void;\n}\n\nconst DEMO_TASKS: DemoTask[] = [\n  {\n    label: \"Publish site\",\n    icon: <Globe aria-hidden=\"true\" className=\"size-4\" />,\n    run: ({ show }) =>\n      show(countTo(24, WORK_MS), {\n        loading: \"Publishing changes\",\n        count: { total: 24, unit: \"pages\", verb: \"Building\" },\n        success: [\"Published\", \"kokonut.dev is live\"],\n        error: \"Couldn’t publish\",\n        undo: {\n          run: () => wait(900),\n          loading: [\"Reverting\", \"Putting the last version back\"],\n          success: [\"Reverted\", \"The previous version is live again\"],\n        },\n      }),\n  },\n  {\n    label: \"Invite Maya\",\n    icon: <UserPlus aria-hidden=\"true\" className=\"size-4\" />,\n    note: \"fails once\",\n    run: ({ show }) => {\n      let tries = 0;\n      show(\n        async () => {\n          tries += 1;\n          await wait(tries === 1 ? WORK_MS * 0.7 : WORK_MS);\n          if (tries === 1) {\n            throw new Error(\"The mail server timed out\");\n          }\n        },\n        {\n          loading: \"Sending invite\",\n          waiting: \"maya@studio.co\",\n          success: [\"Invite sent\", \"Maya can join the workspace\"],\n          error: (e) => [\"Invite failed\", (e as Error).message],\n        }\n      );\n    },\n  },\n  {\n    label: \"Export CSV\",\n    icon: <Download aria-hidden=\"true\" className=\"size-4\" />,\n    run: ({ show }) =>\n      show(countTo(1284, WORK_MS), {\n        loading: \"Exporting orders\",\n        count: { total: 1284, unit: \"rows\", verb: \"Writing\" },\n        success: [\"Export ready\", \"orders-november.csv · 212 KB\"],\n        error: \"Export failed\",\n      }),\n  },\n];\n\nexport interface PromiseToastProps {\n  className?: string;\n}\n\n/** The demo: three tasks to run, and the toaster they land in. */\nexport default function PromiseToast({ className }: PromiseToastProps) {\n  const toaster = usePromiseToast();\n\n  return (\n    <div\n      className={cn(\n        \"relative w-full max-w-sm overflow-hidden rounded-[28px] border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100\",\n        className\n      )}\n    >\n      <div className=\"p-5\">\n        <p className=\"text-[13px] text-zinc-500 dark:text-zinc-400\">\n          Run a task\n        </p>\n        <div className=\"mt-3 flex flex-col gap-2\">\n          {DEMO_TASKS.map((task) => (\n            <button\n              className=\"flex h-11 items-center gap-3 rounded-2xl bg-zinc-100 px-3.5 text-left text-[14px] outline-hidden transition-colors duration-150 hover:bg-zinc-200 focus-visible:ring-2 focus-visible:ring-zinc-400/50 active:bg-zinc-300 dark:bg-zinc-900 dark:active:bg-zinc-700 dark:hover:bg-zinc-800\"\n              key={task.label}\n              onClick={() => task.run(toaster)}\n              type=\"button\"\n            >\n              <span className=\"text-zinc-500 dark:text-zinc-400\">\n                {task.icon}\n              </span>\n              {task.label}\n              {task.note ? (\n                <span className=\"ml-auto text-[12px] text-zinc-400 dark:text-zinc-500\">\n                  {task.note}\n                </span>\n              ) : null}\n            </button>\n          ))}\n        </div>\n      </div>\n\n      <div className=\"relative mx-3 mb-3\">\n        <AnimatePresence>\n          {toaster.toasts.length === 0 && (\n            <motion.p\n              animate={{ opacity: 1 }}\n              className=\"pointer-events-none absolute inset-x-0 bottom-6 text-center text-[12.5px] text-zinc-400 dark:text-zinc-500\"\n              exit={{ opacity: 0, transition: { duration: 0.1 } }}\n              initial={{ opacity: 0 }}\n              transition={{ duration: 0.3, delay: 0.2 }}\n            >\n              Toasts land here\n            </motion.p>\n          )}\n        </AnimatePresence>\n        <Toaster toaster={toaster} />\n      </div>\n    </div>\n  );\n}\n\nfunction ToastItem({\n  toast,\n  index,\n  expanded,\n  paused,\n  onDismiss,\n  onRetry,\n  onUndo,\n}: {\n  toast: ToastState;\n  index: number;\n  expanded: boolean;\n  paused: boolean;\n  onDismiss: () => void;\n  onRetry: () => void;\n  onUndo: () => void;\n}) {\n  const [swiped, setSwiped] = useState(false);\n  const life = useMotionValue(1);\n  const work = useMotionValue(0);\n  const x = useMotionValue(0);\n  // The further it's swiped, the more it fades.\n  const fade = useTransform(x, [0, 160], [1, 0]);\n  const { count } = toast.options;\n  const canUndo = Boolean(toast.options.undo) && !toast.undone;\n  const settled = toast.status === \"success\";\n  const loading = toast.status === \"loading\";\n  const counted = loading && count !== undefined && toast.done !== undefined;\n  const progress =\n    count && toast.done !== undefined ? toast.done / count.total : 0;\n  const dismissRef = useRef(onDismiss);\n  dismissRef.current = onDismiss;\n\n  // Counted work fills the bar along the bottom edge as the task reports.\n  useEffect(() => {\n    if (!counted) {\n      work.set(0);\n      return;\n    }\n    const controls = animate(work, progress, {\n      duration: 0.3,\n      ease: \"easeOut\",\n    });\n    return () => controls.stop();\n  }, [counted, progress, work]);\n\n  // A settled toast drains, then leaves. Hovering or hiding the tab pauses it.\n  useEffect(() => {\n    if (!settled) {\n      life.set(1);\n      return;\n    }\n    const controls = animate(life, 0, {\n      duration: (life.get() * STAY_MS) / 1000,\n      ease: \"linear\",\n      onComplete: () => dismissRef.current(),\n    });\n    if (paused) {\n      controls.pause();\n    }\n    return () => controls.stop();\n  }, [settled, paused, life]);\n\n  const front = index === 0;\n  const hidden = index >= VISIBLE;\n  const y = expanded ? -index * (TOAST_H + GAP) : -index * 12;\n  const scale = expanded ? 1 : 1 - index * 0.05;\n\n  return (\n    <motion.li\n      animate={{ y, scale, opacity: hidden ? 0 : 1 }}\n      className=\"absolute inset-x-0 bottom-0 origin-top touch-pan-y\"\n      drag=\"x\"\n      dragConstraints={{ left: 0, right: 0 }}\n      dragElastic={{ left: 0.05, right: 0.9 }}\n      exit={\n        swiped\n          ? { x: \"110%\", opacity: 0, transition: { duration: 0.2 } }\n          : {\n              y: y + 10,\n              opacity: 0,\n              scale: scale * 0.97,\n              transition: { duration: 0.15, ease: EASE_OUT },\n            }\n      }\n      initial={{ y: TOAST_H, opacity: 0, scale: 1 }}\n      onDragEnd={(_, info) => {\n        // A quick flick is enough; a slow drag has to go most of the way.\n        if (info.offset.x > 100 || info.velocity.x > 400) {\n          setSwiped(true);\n          onDismiss();\n        }\n      }}\n      onKeyDown={(event) => {\n        if (event.key === \"Escape\") {\n          onDismiss();\n        }\n      }}\n      style={{\n        x,\n        zIndex: 100 - index,\n        pointerEvents: hidden ? \"none\" : \"auto\",\n      }}\n      transition={STACK}\n    >\n      <motion.div\n        className=\"group relative flex items-center gap-3 overflow-hidden rounded-2xl border border-zinc-200 bg-white px-3 shadow-[0_6px_20px_rgba(0,0,0,0.08)] dark:border-zinc-800 dark:bg-zinc-900 dark:shadow-[0_6px_20px_rgba(0,0,0,0.4)]\"\n        style={{ height: TOAST_H, opacity: fade }}\n      >\n        {/* Toasts behind the front one stay quiet until the stack fans out. */}\n        <motion.div\n          animate={{ opacity: front || expanded ? 1 : 0 }}\n          className=\"flex min-w-0 flex-1 items-center gap-3\"\n          initial={false}\n          transition={{ duration: 0.2 }}\n        >\n          <StatusIcon status={toast.status} />\n          <div className=\"relative min-w-0 flex-1\">\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              <motion.div\n                animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n                exit={{ opacity: 0, y: -6, filter: \"blur(2px)\" }}\n                initial={{ opacity: 0, y: 6, filter: \"blur(2px)\" }}\n                key={toast.title}\n                transition={{ duration: 0.22, ease: EASE_OUT }}\n              >\n                <p className=\"truncate font-medium text-[14px]\">\n                  {toast.title}\n                </p>\n                <p className=\"truncate text-[12.5px] text-zinc-500 tabular-nums dark:text-zinc-400\">\n                  {counted && count ? (\n                    <Counted count={count} work={work} />\n                  ) : (\n                    toast.body\n                  )}\n                </p>\n              </motion.div>\n            </AnimatePresence>\n          </div>\n\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {toast.status === \"error\" && (\n              <ActionButton key=\"retry\" onClick={onRetry}>\n                Retry\n              </ActionButton>\n            )}\n            {settled && canUndo && (\n              <ActionButton key=\"undo\" onClick={onUndo}>\n                <svg\n                  aria-hidden=\"true\"\n                  className=\"-ml-0.5 size-4 -rotate-90\"\n                  viewBox=\"0 0 16 16\"\n                >\n                  <circle\n                    className=\"fill-none stroke-zinc-300 dark:stroke-zinc-600\"\n                    cx={8}\n                    cy={8}\n                    r={6}\n                    strokeWidth={2}\n                  />\n                  <motion.circle\n                    className=\"fill-none stroke-zinc-900 dark:stroke-zinc-100\"\n                    cx={8}\n                    cy={8}\n                    r={6}\n                    strokeLinecap=\"round\"\n                    strokeWidth={2}\n                    style={{ pathLength: life }}\n                  />\n                </svg>\n                Undo\n              </ActionButton>\n            )}\n          </AnimatePresence>\n          <button\n            aria-label=\"Dismiss\"\n            className=\"flex size-7 shrink-0 items-center justify-center rounded-full text-zinc-400 outline-hidden transition-[opacity,color] duration-150 hover:text-zinc-700 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-zinc-400/50 dark:hover:text-zinc-200 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100\"\n            onClick={onDismiss}\n            type=\"button\"\n          >\n            <X aria-hidden=\"true\" className=\"size-3.5\" />\n          </button>\n        </motion.div>\n\n        {/* Counted work fills a hairline along the bottom edge. */}\n        <AnimatePresence>\n          {counted && (\n            <motion.span\n              aria-hidden=\"true\"\n              className=\"absolute inset-x-0 bottom-0 h-[2px] origin-left bg-zinc-900 dark:bg-zinc-100\"\n              exit={{ opacity: 0, transition: { duration: 0.3 } }}\n              style={{ scaleX: work }}\n            />\n          )}\n        </AnimatePresence>\n      </motion.div>\n    </motion.li>\n  );\n}\n\nfunction Counted({\n  work,\n  count,\n}: {\n  work: MotionValue<number>;\n  count: ToastCount;\n}) {\n  const text = useTransform(\n    work,\n    (v) =>\n      `${count.verb} ${Math.round(v * count.total).toLocaleString(\"en-US\")} of ${count.total.toLocaleString(\"en-US\")} ${count.unit}`\n  );\n  return <motion.span>{text}</motion.span>;\n}\n\nfunction ActionButton({\n  onClick,\n  children,\n}: {\n  onClick: () => void;\n  children: ReactNode;\n}) {\n  return (\n    <motion.button\n      animate={{ opacity: 1, filter: \"blur(0px)\" }}\n      className=\"flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-zinc-100 px-3 font-medium text-[12.5px] outline-hidden transition-colors duration-150 hover:bg-zinc-200 focus-visible:ring-2 focus-visible:ring-zinc-400/50 active:bg-zinc-300 dark:bg-zinc-800 dark:active:bg-zinc-600 dark:hover:bg-zinc-700\"\n      exit={{ opacity: 0, filter: \"blur(2px)\", transition: { duration: 0.12 } }}\n      initial={{ opacity: 0, filter: \"blur(2px)\" }}\n      onClick={onClick}\n      transition={{ duration: 0.2, delay: 0.1, ease: EASE_OUT }}\n      type=\"button\"\n    >\n      {children}\n    </motion.button>\n  );\n}\n\nconst ICON_TONE: Record<Status, string> = {\n  loading: \"text-zinc-400 dark:text-zinc-500\",\n  success: \"text-emerald-500\",\n  error: \"text-rose-500\",\n};\n\n/** One ring: it spins while working, closes when done, then draws the mark. */\nfunction StatusIcon({ status }: { status: Status }) {\n  const working = status === \"loading\";\n  return (\n    <span\n      className={cn(\n        \"relative flex size-8 shrink-0 items-center justify-center transition-colors duration-300\",\n        ICON_TONE[status]\n      )}\n    >\n      <motion.svg\n        animate={working ? { rotate: 360 } : { rotate: 0 }}\n        aria-hidden=\"true\"\n        className=\"size-8\"\n        fill=\"none\"\n        transition={\n          working\n            ? {\n                duration: 0.9,\n                ease: \"linear\",\n                repeat: Number.POSITIVE_INFINITY,\n              }\n            : { duration: 0 }\n        }\n        viewBox=\"0 0 32 32\"\n      >\n        <motion.circle\n          animate={{ pathLength: working ? 0.3 : 1 }}\n          cx={16}\n          cy={16}\n          initial={false}\n          r={13}\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeWidth={2.5}\n          style={{ rotate: -90, transformOrigin: \"16px 16px\" }}\n          transition={{ duration: 0.35, ease: EASE_OUT }}\n        />\n      </motion.svg>\n      <svg\n        aria-hidden=\"true\"\n        className=\"absolute inset-0 size-8\"\n        fill=\"none\"\n        viewBox=\"0 0 32 32\"\n      >\n        <AnimatePresence initial={false}>\n          {status === \"success\" && (\n            <motion.path\n              animate={{ pathLength: 1 }}\n              d=\"M10.5 16.5l3.6 3.5 7.4-7.6\"\n              exit={{ opacity: 0, transition: { duration: 0.1 } }}\n              initial={{ pathLength: 0 }}\n              key=\"check\"\n              stroke=\"currentColor\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth={2.5}\n              transition={{ duration: 0.25, delay: 0.2, ease: EASE_OUT }}\n            />\n          )}\n          {status === \"error\" && (\n            <motion.path\n              animate={{ pathLength: 1 }}\n              d=\"M16 10v7.5M16 21.6v.1\"\n              exit={{ opacity: 0, transition: { duration: 0.1 } }}\n              initial={{ pathLength: 0 }}\n              key=\"bang\"\n              stroke=\"currentColor\"\n              strokeLinecap=\"round\"\n              strokeWidth={2.5}\n              transition={{ duration: 0.2, delay: 0.2, ease: EASE_OUT }}\n            />\n          )}\n        </AnimatePresence>\n      </svg>\n    </span>\n  );\n}\n",
      "path": "/components/kokonutui/promise-toast.tsx",
      "target": "components/kokonutui/promise-toast.tsx"
    }
  ]
}