ash_hq/lib/ash_hq_web/components/community_link.ex

47 lines
1.2 KiB
Elixir
Raw Normal View History

defmodule AshHqWeb.Components.CommunityLink do
@moduledoc "A component for rendering a link for the Community page."
use Surface.Component
import AshHqWeb.Tails
prop name, :string, required: true
prop class, :string, default: nil
prop url, :string, required: true
slot icon
slot description
def render(assigns) do
~F"""
<div class="flex flex-col items-center">
<div class={classes(["w-16 h-16 text-primary-light-600 dark:text-primary-dark-400", @class])}>
<#slot {@icon} />
</div>
<a
href={@url}
class="font-bold text-3xl mt-4 hover:underline flex flex-row items-center space-x-2"
>
<span>{@name}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
/>
</svg>
</a>
<div class="text-xl mt-4">
<#slot {@description} />
</div>
</div>
"""
end
end