defmodule PetalComponents.Card do
use Phoenix.Component
import PetalComponents.Avatar
import PetalComponents.Typography
attr(:class, :any, default: nil, doc: "CSS class")
attr(:variant, :string, default: "basic", values: ["basic", "outline"])
attr(:rest, :global)
slot(:inner_block, required: false)
def card(assigns) do
~H"""
{@category}
{@heading}
{render_slot(@inner_block)}
"""
end
attr(:class, :any, default: nil, doc: "CSS class")
attr(:rest, :global)
slot(:inner_block, required: false)
def card_footer(assigns) do
~H"""
"""
end
attr(:name, :string, required: true, doc: "The reviewer's name")
attr(:username, :string, required: true, doc: "The reviewer's username")
attr(:img, :string, required: true, doc: "URL of the reviewer's avatar")
attr(:body, :string, required: true, doc: "The review text content")
attr(:class, :string, default: "", doc: "Additional classes")
attr(:rest, :global)
def review_card(assigns) do
~H"""