.header>
Listing Articles
<:actions>
<.link patch={~p"/articles/new"}>
<.button>New Article
<.table id="articles" rows={@articles} row_click={&JS.navigate(~p"/articles/#{&1}")}>
<:col :let={article} label="Title"><%= article.title %>
<:col :let={article} label="Content"><%= article.content %>
<:col :let={article} label="Url"><%= article.url %>
<:col :let={article} label="Language"><%= article.language %>
<:col :let={article} label="Date"><%= article.date %>
<:action :let={article}>
<.link navigate={~p"/articles/#{article}"}>Show
<.link patch={~p"/articles/#{article}/edit"}>Edit
<:action :let={article}>
<.link phx-click={JS.push("delete", value: %{id: article.id})} data-confirm="Are you sure?">
Delete
<.modal
:if={@live_action in [:new, :edit]}
id="article-modal"
show
on_cancel={JS.navigate(~p"/articles")}
>
<.live_component
module={OutlookWeb.ArticleLive.FormComponent}
id={@article.id || :new}
title={@page_title}
action={@live_action}
article={@article}
navigate={~p"/articles"}
/>