livebook/lib/livebook_web/live/session_live/custom_view_component.ex
Jonatan Kłosko 46a9452298
Add notebook custom view (#2101)
Co-authored-by: gitstart <bot@gitstart.com>
Co-authored-by: Hameed Abdulrahaman <hameedabdulrahamann@gmail.com>
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
2023-07-24 14:20:42 +02:00

37 lines
1.1 KiB
Elixir

defmodule LivebookWeb.SessionLive.CustomViewComponent do
use LivebookWeb, :live_component
@impl true
def render(assigns) do
~H"""
<div class="p-6">
<h3 class="text-2xl font-semibold text-gray-800">
Custom view
</h3>
<p class="mt-8 text-gray-700">
Configure notebook display options.
</p>
<h3 class="mt-8 text-lg font-semibold text-gray-800">
Options
</h3>
<div
class="mt-2 flex flex-col gap-2"
id="custom-settings"
data-el-custom
phx-hook="CustomViewSettings"
phx-update="ignore"
>
<.switch_field name="show_section" label="Show sections" value={false} />
<.switch_field name="show_markdown" label="Show markdown" value={false} />
<.switch_field name="show_output" label="Show outputs" value={false} />
<.switch_field name="spotlight" label="Spotlight focused" value={false} />
</div>
<div class="mt-8 flex justify-end space-x-2">
<.link patch={@return_to} class="button-base button-outlined-gray">
Close
</.link>
</div>
</div>
"""
end
end