mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-16 04:46:46 +08:00
c1654345b7
* Update phoenix deps
* Update reference to LiveDashboard encode_pid
* Fix form input id references
* Move to HEEx
* Update back to filesystem LV npm package
* Further HEEx rewrites
* Refactor icons into function components
* .html.leex -> .html.heex
* Further refactoring
* Move render helpers into function components
* Add doctype back
* Further refactoring
* Refactor cell component
* Further refactoring
* Compose sidebar using function components
* Rewrite notebook card component as function component
* Fruther refactoring
* Fix race condition in runtime tests
* Rewrite tooltips into function component
* Update Tailwind purge rules
* Revert "Rewrite tooltips into function component"
This reverts commit bd6ca8f0b5
.
* Refactor conditional tooltip
15 lines
356 B
Elixir
15 lines
356 B
Elixir
defmodule LivebookWeb.Output.ImageComponent do
|
|
use LivebookWeb, :live_component
|
|
|
|
@impl true
|
|
def render(assigns) do
|
|
~H"""
|
|
<img src={data_url(@content, @mime_type)} alt="output image" />
|
|
"""
|
|
end
|
|
|
|
defp data_url(content, mime_type) do
|
|
image_base64 = Base.encode64(content)
|
|
["data:", mime_type, ";base64,", image_base64]
|
|
end
|
|
end
|