defmodule LivebookWeb.LearnHelpers do use Phoenix.Component alias LivebookWeb.Router.Helpers, as: Routes @doc """ Renders an learn notebook card. """ def notebook_card(assigns) do ~H""" <%= live_redirect to: Routes.learn_path(@socket, :notebook, @notebook_info.slug), class: "flex flex-col border-2 border-gray-100 hover:border-gray-200 rounded-2xl" do %>
{"#{@notebook_info.title}
<%= @notebook_info.title %>

<%= @notebook_info.details.description %>

<% end %> """ end defp img_src(_socket, "data:" <> _ = url), do: url defp img_src(socket, url), do: Routes.static_path(socket, url) end