diff --git a/assets/components/products.jsx b/assets/components/products.jsx index 75c4519..c4e2425 100644 --- a/assets/components/products.jsx +++ b/assets/components/products.jsx @@ -6,11 +6,11 @@ import { ChevronUpDownIcon, } from '@heroicons/react/16/solid' -function Products({ products, selected }) { +function Products({ products, interval, selected }) { return ( - {products.find(({ slug }) => slug === selected)?.name || products[0].name} + {products.find(({ reference }) => reference === selected)?.name || products[0].name} ( ) + root.render() } \ No newline at end of file diff --git a/lib/opsmaru_web/components/pricing_components.ex b/lib/opsmaru_web/components/pricing_components.ex index 61f63b5..55568ee 100644 --- a/lib/opsmaru_web/components/pricing_components.ex +++ b/lib/opsmaru_web/components/pricing_components.ex @@ -111,6 +111,7 @@ defmodule OpsmaruWeb.PricingComponents do attr :products, :list, required: true attr :features, :list, required: true attr :product_features, :list, required: true + attr :focus_product, :string, default: nil def matrix(assigns) do ~H""" @@ -120,7 +121,9 @@ defmodule OpsmaruWeb.PricingComponents do <.display :for={product <- @products} + product={product} feature={feature} + focus_product={@focus_product} product_feature={match_product_feature(@product_features, product, feature)} /> @@ -128,11 +131,16 @@ defmodule OpsmaruWeb.PricingComponents do end attr :feature, Content.Feature, required: true + attr :product, Content.Product, required: true attr :product_feature, Products.Feature, default: nil + attr :focus_product, :string, default: nil def display(assigns) do ~H""" - +
{@product_feature.remark}
diff --git a/lib/opsmaru_web/live/pricing_live.ex b/lib/opsmaru_web/live/pricing_live.ex index 3f0a52e..7c4bd02 100644 --- a/lib/opsmaru_web/live/pricing_live.ex +++ b/lib/opsmaru_web/live/pricing_live.ex @@ -171,6 +171,7 @@ defmodule OpsmaruWeb.PricingLive do