defmodule OgImageWeb.SharedComponents do
  @moduledoc """
  Shared components for templates.
  """

  use Phoenix.Component

  @doc """
  Renders the SavvyCal logo.
  """
  attr :height, :string, default: "64"

  def savvycal_logo(assigns) do
    ~H"""
    <svg height={@height} viewBox="0 0 684 145" fill="none" xmlns="http://www.w3.org/2000/svg">
      <g stroke="currentColor" stroke-width="7" stroke-miterlimit="10" stroke-linejoin="round">
        <path d="M104.053 87.706c-1.66-18.06-20.599-22.16-44.614-25.773-3.32-.488-5.662-3.416-5.662-6.638a6.704 6.704 0 016.346-6.54c16.01-.684 47.347-.196 47.64-18.061.195-11.91-16.206-25.187-42.467-25.675C36.79 4.336 6.723 22.103 5.063 57.931c-1.464 33.973 22.746 60.038 60.624 60.722 28.604.488 39.44-18.549 38.366-30.947z" />
        <path d="M29.274 56.467c1.66 18.06 20.598 22.16 44.614 25.772 3.319.488 5.662 3.417 5.662 6.638a6.704 6.704 0 01-6.346 6.541c-16.01.684-47.347.195-47.64 18.061-.195 11.91 16.206 25.186 42.466 25.675 28.506.488 58.574-17.28 60.136-53.108 1.465-33.875-22.746-59.94-60.624-60.624-28.506-.39-39.44 18.646-38.268 31.045z" />
      </g>
      <g fill="currentColor">
        <path d="M153.229 96.8l16.3-11.5c4.7 9.5 12.8 15.9 25.1 15.9 8.9 0 15.9-3.3 15.9-10.6 0-6.9-4.1-9.5-13.5-11.5l-12.4-2.6c-16.2-3.5-25.6-12.3-25.6-27.8 0-17 14-27.6 36.2-27.6 16.6 0 30.3 6 37 18.4l-14.4 12.2c-4.6-9-13.3-14.2-23.9-14.2-8.8 0-14.4 3.7-14.4 9.5 0 6 3.7 9 13.5 11.2l13.5 2.9c16.5 3.7 25.5 11.5 25.5 27.5 0 17.6-13.7 29.8-38 29.8-20.2-.1-34.5-8.6-40.8-21.6zM234.729 98.3c0-6.1 2.2-11 6.7-14.1 4.3-3 10.599-5.1 20.499-6.4l15.801-2.2v-2.2c0-7.5-3.1-10.7-9.7-10.7-6.4 0-10.1 3.4-10.5 9.7h-20.8c1-14.5 12.8-23.1 31.4-23.1 21 0 30.5 8.2 30.5 27.1v21.7c0 7.7.699 14.1 1.799 18.2h-20.399c-.7-3.1-.9-6.7-1-10.3-3.3 7.3-11.6 11.9-21.8 11.9-13.5-.2-22.5-7.9-22.5-19.6zm30.3 6c8 0 13.3-5.4 13.3-13.2v-5.2l-11.2 1.8c-7.7 1.4-11.2 4.2-11.2 9 0 4.6 3.6 7.6 9.1 7.6zM297.229 50.7h21.6l10.599 38.6c.9 3 1.6 6.3 2 9.3h.301c.4-3 1-6.3 2-9.3l10.4-38.6h21.6l-22.7 65.4h-23l-22.8-65.4z" />
        <path d="M363.129 50.7h21.5l10.6 38.6c.9 3 1.6 6.3 2 9.3h.3c.4-3 1-6.3 2-9.3l10.5-38.6h21.6l-22.7 65.4h-23l-22.8-65.4z" />
        <path d="M433.029 141.5v-15.3c3.1.5 4.7.7 6.3.7 7.6 0 11.6-2.5 13.5-8.4l.9-2.7-25-65h22.9l11.4 39.7c.8 2.7 1.299 4.8 1.399 7.6h.401c.3-2.2.699-4.3 1.599-7.6l10.5-39.8h21l-23.299 68.2c-5.9 16.9-15.8 23.3-33.1 23.3-2 .1-5.2-.2-8.5-.7zM500.129 69.8c0-29.3 17.3-48.8 45.5-48.8 23.7 0 38.6 13.1 41 33.3l-22.4 3.9c-1.3-12.3-8.1-19.5-19.2-19.5-14.1 0-22.4 11.9-22.4 30.8 0 18.4 8.4 30.7 23 30.7 10.3 0 17.3-7.1 19.1-19.1l22.4 4.8c-4.4 19.6-18.8 32.2-41.8 32.2-29.4.2-45.2-19-45.2-48.3zM589.229 98.3c0-6.1 2.2-11 6.7-14.1 4.3-3 10.6-5.1 20.5-6.4l15.8-2.2v-2.2c0-7.5-3.1-10.7-9.7-10.7-6.4 0-10.1 3.4-10.5 9.7h-20.8c1-14.5 12.8-23.1 31.4-23.1 21 0 30.5 8.2 30.5 27.1v21.7c0 7.7.7 14.1 1.8 18.2h-20.3c-.7-3.1-.9-6.7-1-10.3-3.3 7.3-11.6 11.9-21.8 11.9-13.6-.2-22.6-7.9-22.6-19.6zm30.4 6c8 0 13.3-5.4 13.3-13.2v-5.2l-11.3 1.8c-7.7 1.4-11.2 4.2-11.2 9 0 4.6 3.7 7.6 9.2 7.6zM682.229 116.1h-21V21.3h21v94.8z" />
      </g>
    </svg>
    """
  end

  @doc """
  Renders the SavvyCal logomark.
  """
  attr :height, :string, default: "56"

  def savvycal_logomark(assigns) do
    ~H"""
    <svg fill="currentColor" height={@height} viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
      <path d="m15.9746 26.7849c-4.2165 0-7.95375-1.4489-10.51715-4.0832-2.39569-2.4667-3.66541-5.8555-3.56958-9.5555.22759-8.15457 6.98345-12.429403 13.53563-12.429403 2.7551 0 5.3065.658583 7.1752 1.844043 1.8087 1.14954 2.8508 2.7062 2.8508 4.27484 0 4.25092-6.2887 4.57422-10.0379 4.76582-.3115.0119-.599.0359-.8745.0479-.3833.0239-.6708.3352-.6708.7184 0 .3592.2636.6586.6229.7065 2.5514.3473 5.007.7304 6.8757 1.5686 2.1321.958 3.2821 2.4189 3.5097 4.4784.1796 1.6405-.4552 3.4486-1.701 4.8496-1.1499 1.2933-3.33 2.814-7.199 2.814zm-.5511-24.63118c-3.0185 0-6.00117 1.01781-8.18125 2.80199-2.46757 2.01169-3.82114 4.86158-3.90499 8.23829-.08385 3.305 1.03015 6.3225 3.16232 8.5138 2.28789 2.347 5.65382 3.6522 9.48692 3.6522 3.342 0 5.1628-1.2693 6.121-2.3231 1.15-1.2932 1.4494-2.778 1.3416-3.724-.3713-3.3408-4.0367-4.0952-9.1515-4.7897-1.0661-.1437-1.8567-1.0657-1.8567-2.1314 0-1.1376.8864-2.0836 2.0244-2.1554.2755-.012.5749-.0359.8864-.0479 4.2044-.21555 8.6844-.67057 8.6844-3.34085-.024-1.97576-3.0066-4.69393-8.6126-4.69393z" />
      <path d="m16.5611 31.2632c-2.755 0-5.3064-.6586-7.17507-1.8441-1.80875-1.1495-2.85087-2.7062-2.85087-4.2748 0-4.2509 6.28874-4.5742 10.03794-4.7658.3115-.012.5989-.0359.8745-.0479.3833-.0239.6707-.3353.6707-.7185 0-.3592-.2635-.6585-.6228-.7064-2.5515-.3473-5.007-.7305-6.8757-1.5687-2.13215-.9579-3.28209-2.4188-3.50968-4.4784-.17967-1.6405.45519-3.44858 1.70095-4.84958 1.14993-1.28125 3.31803-2.80199 7.18713-2.80199 4.2164 0 7.9537 1.44889 10.5171 4.08325 2.3957 2.46672 3.6654 5.85542 3.5695 9.55552-.2036 8.1425-6.9594 12.4174-13.5237 12.4174zm-8.01356-18.5722c.37133 3.3408 4.03676 4.0952 9.15156 4.7897 1.0661.1437 1.8567 1.0657 1.8567 2.1314 0 1.1376-.8864 2.0836-2.0244 2.1554-.2755.012-.575.036-.8864.0479-4.2045.2156-8.6844.6706-8.6844 3.3409 0 1.9638 2.9826 4.6819 8.5886 4.6819 3.0305 0 6.0132-1.0178 8.1813-2.79 2.4675-2.0117 3.8211-4.8616 3.905-8.2383.0838-3.3049-1.0302-6.3225-3.1624-8.5138-2.2639-2.3709-5.6299-3.66412-9.463-3.66412-3.33 0-5.1627 1.2573-6.12097 2.32302-1.14993 1.2932-1.4494 2.778-1.34159 3.736z" />
    </svg>
    """
  end
end
