defmodule AshHqWeb.Components.Docs.Functions do @moduledoc "Lists all of the provided functions" use Surface.Component alias AshHqWeb.Components.Docs.SourceLink prop(type, :atom, required: true) prop(functions, :list, required: true) prop(header, :string, required: true) prop(library, :any, required: true) prop(library_version, :any, required: true) prop(libraries, :list, required: true) prop(selected_versions, :map, required: true) def render(assigns) do ~F""" {#case Enum.filter(@functions, &(&1.type == @type))} {#match []} {#match functions}

{@header}

{#for function <- functions} {/for} {/case} """ end defp rendered(html) do html |> String.split("") |> case do [] -> "" [string] -> string [heads, docs] -> if String.trim(docs) == "" do """
#{heads}
#{docs} """ else """
#{heads}
#{docs} """ end end end end