(defcomp
  (&key
    (name :as string)
    (path :as string)
    (mode :as string)
    (has-data :as boolean)
    (content-expr :as string?)
    (reason :as string?))
  (div
    :class (str
      "rounded border p-3 flex items-center gap-3 "
      (if
        (= mode "client")
        "border-green-200 bg-green-50"
        "border-amber-200 bg-amber-50"))
    (span
      :class (str
        "inline-block px-2 py-0.5 rounded text-xs font-bold uppercase "
        (if
          (= mode "client")
          "bg-green-600 text-white"
          "bg-amber-500 text-white"))
      mode)
    (div
      (~tw :tokens "flex-1 min-w-0")
      (div
        (~tw :tokens "flex items-center gap-2")
        (span (~tw :tokens "font-mono font-semibold text-stone-800 text-sm") name)
        (span (~tw :tokens "text-stone-400 text-xs font-mono") path))
      (when reason (div (~tw :tokens "text-xs text-stone-500 mt-0.5") reason)))
    (when
      content-expr
      (div
        (~tw :tokens "hidden md:block max-w-xs truncate")
        (code (~tw :tokens "text-xs text-stone-500") content-expr)))))
