# ============================================================================ # COMMENTED OUT: Component-based rendering system - Hero Component # ============================================================================ # This module was part of an experimental component-based page building system # using XML-style markup (.phk files) with swappable design variants. # Related to: lib/phoenix_kit/publishing/page_builder.ex # ============================================================================ # defmodule PhoenixKitWeb.Components.Publishing.Hero do # @moduledoc """ # Hero section component with multiple variants. # # Variants: # - `split-image`: Hero with content on left, image on right # - `centered`: Centered content with optional background # - `minimal`: Simple centered text-only hero # # Example usage in .phk file: # ```xml # # Build Your SaaS Faster # Start shipping in days, not months # Get Started # Learn More # Dashboard # # ``` # """ # use Phoenix.Component # # attr :variant, :string, default: "centered" # attr :children, :list, default: [] # attr :attributes, :map, default: %{} # attr :content, :string, default: nil # # def render(assigns) do # case assigns.variant do # "split-image" -> render_split_image(assigns) # "centered" -> render_centered(assigns) # "minimal" -> render_minimal(assigns) # _ -> render_centered(assigns) # end # end # # # Split Image Variant: Content on left, image on right # defp render_split_image(assigns) do # ~H""" #
#
#
#
# <%= for child <- @children do %> # <%= if child.type in [:headline, :subheadline, :cta] do %> # {render_child(child, assigns)} # <% end %> # <% end %> #
#
# <%= for child <- @children do %> # <%= if child.type == :image do %> # {render_child(child, assigns)} # <% end %> # <% end %> #
#
#
#
# """ # end # # # Centered Variant: All content centered # defp render_centered(assigns) do # ~H""" #
#
#
# <%= for child <- @children do %> # {render_child(child, assigns)} # <% end %> #
#
#
# """ # end # # # Minimal Variant: Simple text-only hero # defp render_minimal(assigns) do # ~H""" #
#
#
# <%= for child <- @children do %> # {render_child(child, assigns)} # <% end %> #
#
#
# """ # end # # defp render_child(child, assigns) do # case PhoenixKitWeb.Live.Modules.Publishing.PageBuilder.Renderer.render(child, assigns) do # {:ok, html} -> html # {:error, _} -> "" # end # end # end