defmodule MoonWeb.Pages.Components.AvatarPage do
@moduledoc false
use MoonWeb, :live_view
alias Moon.Components.Avatar
alias Moon.Components.Avatar.StatusOrigin
alias MoonWeb.Components.ExampleAndCode
alias MoonWeb.Components.Page
alias MoonWeb.Components.ComponentPageDescription
alias MoonWeb.Components.PropsTable
alias MoonWeb.Components.Facing.DeprecationWarning
data(breadcrumbs, :any,
default: [
%{
to: "#",
name: "Components v1"
},
%{
to: "/components/avatar",
name: "Avatar"
}
]
)
data(props_info_array, :list,
default: [
%{
:name => ~c"bg_color",
:type => ~c"string",
:required => ~c"No",
:default => ~c"bg-goku",
:description => ~c"Background color"
},
%{
:name => ~c"color",
:type => ~c"string",
:required => ~c"No",
:default => ~c"text-bulma",
:description => ~c"Text color"
},
%{
:name => ~c"image_url",
:type => ~c"string",
:required => ~c"No",
:default => ~c"-",
:description => ~c"Path to the image"
},
%{
:name => ~c"is_rounded",
:type => ~c"boolean",
:required => ~c"No",
:default => ~c"false",
:description => ~c""
},
%{
:name => ~c"is_status_active",
:type => ~c"boolean",
:required => ~c"No",
:default => ~c"false",
:description => ~c"Active state for status indication"
},
%{
:name => ~c"name",
:type => ~c"string",
:required => ~c"No",
:default => ~c"-",
:description => ~c"Capital letters of name"
},
%{
:name => ~c"size",
:type => ~c"xs | sm | md | lg | xl | 2xl",
:required => ~c"No",
:default => ~c"md",
:description => ~c"Size for avatar"
},
%{
:name => ~c"status_origin",
:type => ~c"%StatusOrigin{ vertical: top | bottom, horizontal: left | right }",
:required => ~c"No",
:default => ~c"%StatusOrigin{vertical: \"bottom\", horizontal: \"right\"}",
:description => ~c"Position for status indication"
}
]
)
def handle_params(_params, uri, socket) do
{:noreply, assign(socket, uri: uri)}
end
@spec render(any) :: Phoenix.LiveView.Rendered.t()
def render(assigns) do
~F"""