add links

This commit is contained in:
zack 2024-10-21 13:57:31 -04:00
parent 3842798968
commit e2b802f968
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
54 changed files with 4984 additions and 6 deletions

View file

@ -0,0 +1,30 @@
<div class="flex gap-2">
<h1 class="text-2xl grow font-bold">Links</h1>
<.link
navigate={~p"/links/new"}
class="bg-black border border-black hover:bg-gray-700 text-white font-bold py-2 px-3 rounded-md"
>
Add Link
</.link>
</div>
<div class="divide-y">
<div :for={link <- @links}>
<div>
<div class="font-bold"><%= link.url %></div>
<div class="text-sm"><%= link.inserted_at %></div>
</div>
</div>
</div>
<.form for={@form} phx-submit="submit">
<div class="flex gap-2 items-end">
<div class="grow">
<.input field={@form[:url]} type="text" label="url" />
</div>
<button class="bg-black border border-black hover:bg-gray-700 text-white font-bold py-2 px-3 rounded-md">
Create
</button>
</div>
</.form>