2022-09-13 11:36:28 +12:00
|
|
|
defmodule AshHqWeb.Components.Docs.DocPath do
|
2022-11-17 08:36:05 +13:00
|
|
|
@moduledoc "Renders breadcrumbs to the path of the doc currently being viewed"
|
2022-09-13 11:36:28 +12:00
|
|
|
use Surface.Component
|
|
|
|
|
|
|
|
alias AshHqWeb.Components.CalloutText
|
|
|
|
|
|
|
|
prop doc_path, :list, required: true
|
|
|
|
|
|
|
|
def render(assigns) do
|
|
|
|
~F"""
|
|
|
|
<div class="flex flex-row space-x-1 items-center">
|
2022-09-13 12:35:59 +12:00
|
|
|
{#case @doc_path}
|
|
|
|
{#match [item]}
|
|
|
|
<div class="dark:text-white">
|
2022-09-13 11:36:28 +12:00
|
|
|
{item}
|
2022-09-13 12:35:59 +12:00
|
|
|
</div>
|
|
|
|
{#match path}
|
|
|
|
{#for item <- :lists.droplast(path)}
|
|
|
|
<span class="text-base-light-400">
|
|
|
|
{item}
|
|
|
|
</span>
|
|
|
|
<Heroicons.Outline.ChevronRightIcon class="w-3 h-3" />
|
|
|
|
{/for}
|
|
|
|
<span class="dark:text-white">
|
|
|
|
<CalloutText text={List.last(path)} />
|
2022-09-13 11:36:28 +12:00
|
|
|
</span>
|
2022-09-13 12:35:59 +12:00
|
|
|
{/case}
|
2022-09-13 11:36:28 +12:00
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
end
|
|
|
|
end
|