(defisland
  ()
  (let
    ((query (signal ""))
      (all-items
        (list
          "Signals"
          "Effects"
          "Computed"
          "Batch"
          "Stores"
          "Islands"
          "Portals"
          "Error Boundaries"
          "Resources"
          "Input Binding"
          "Keyed Lists"
          "Event Bridge"
          "Reactive Text"
          "Reactive Attrs"
          "Reactive Fragments"
          "Disposal"
          "Hydration"
          "CSSX"
          "Macros"
          "Refs"))
      (filtered (signal (list)))
      (pending (signal false)))
    (reset! filtered all-items)
    (let
      ((_eff (effect (fn () (let ((q (lower (deref query)))) (if (= q "") (do (reset! pending false) (reset! filtered all-items)) (do (reset! pending true) (schedule-idle (fn () (batch (fn () (reset! filtered (filter (fn (item) (contains? (lower item) q)) all-items)) (reset! pending false))))))))))))
      (div
        (~tw :tokens "rounded border border-violet-200 bg-violet-50 p-4 my-4 space-y-3")
        (div
          (~tw :tokens "flex items-center gap-3")
          (input
            :type "text"
            :bind query
            :placeholder "Filter features..."
            (~tw :tokens "px-3 py-1.5 rounded border border-stone-300 text-sm focus:outline-none focus:border-violet-400 w-48"))
          (when
            (deref pending)
            (span (~tw :tokens "text-xs text-stone-400") "Filtering...")))
        (ul
          (~tw :tokens "space-y-1")
          (map
            (fn
              (item)
              (li
                :key item
                (~tw :tokens "text-sm text-stone-700 bg-white rounded px-3 py-1.5")
                item))
            (deref filtered)))))))
