mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-12 10:49:29 +08:00
f70581f255
* Add explore page * Move sidebar to a configurable component * Fix homepage test * Add images * Store example notebooks in files and make explore notebooks linkable * Fix tests * Raise on invalid notebook slug * Keep just the file contents in notebook info * Move notebook lookup to Explore * Exclude notebooks in progress
22 lines
776 B
Elixir
22 lines
776 B
Elixir
defmodule LivebookWeb.NotebookCardComponent do
|
|
use LivebookWeb, :live_component
|
|
|
|
@impl true
|
|
def render(assigns) do
|
|
~L"""
|
|
<div class="flex flex-col">
|
|
<div class="flex items-center justify-center p-6 border-2 border-gray-100 rounded-t-2xl h-[150px]">
|
|
<img src="<%= @notebook_info.image_url %>" class="max-h-full max-w-[75%]" />
|
|
</div>
|
|
<div class="px-6 py-4 bg-gray-100 rounded-b-2xl flex-grow">
|
|
<%= live_redirect @notebook_info.title,
|
|
to: Routes.explore_path(@socket, :notebook, @notebook_info.slug),
|
|
class: "text-gray-800 font-semibold cursor-pointer" %>
|
|
<p class="mt-2 text-sm text-gray-600">
|
|
<%= @notebook_info.description %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
"""
|
|
end
|
|
end
|