Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

1.4 KB
Raw Blame
---
const { title, lastItem, children } = Astro.props;
---

<li class="relative list-none">
  <details class="group relative">
    <summary
      class="flex cursor-pointer list-none items-center gap-1 px-3.5 py-2 text-[13.5px] font-semibold text-slate-600 hover:text-emerald-700 hover:bg-slate-100/70 rounded-full transition-colors [&::-webkit-details-marker]:hidden select-none"
    >
      <span>{title}</span>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        fill="none"
        viewBox="0 0 24 24"
        stroke-width="2.5"
        stroke="currentColor"
        class="w-3 h-3 mt-0.5 transition-transform duration-200 group-open:rotate-180"
      >
        <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"></path>
      </svg>
    </summary>

    <div
      class:list={[
        "absolute z-50 mt-1.5 w-52 rounded-2xl border border-slate-200/90 bg-white/95 backdrop-blur-md p-1.5 shadow-xl transition-all",
        lastItem ? "right-0 origin-top-right" : "left-0 origin-top-left",
      ]}
    >
      <div class="flex flex-col gap-0.5">
        {
          children.map((item) => (
            <a
              href={item.path}
              class="flex items-center px-3 py-2 text-[13px] font-medium text-slate-700 hover:text-emerald-700 hover:bg-emerald-50/70 rounded-xl transition-colors"
            >
              {item.title}
            </a>
          ))
        }
      </div>
    </div>
  </details>
</li>