2026-02-12 08:35:22 +00:00
|
|
|
<.header>
|
|
|
|
|
Providers
|
|
|
|
|
<:actions>
|
2026-02-17 23:05:01 +00:00
|
|
|
<div class="admin-dropdown">
|
|
|
|
|
<div tabindex="0" role="button" class="admin-btn admin-btn-primary">
|
2026-02-15 10:53:15 +00:00
|
|
|
<.icon name="hero-plus" class="size-4 mr-1" /> Connect provider
|
|
|
|
|
</div>
|
2026-02-17 23:05:01 +00:00
|
|
|
<ul tabindex="0" class="admin-dropdown-content">
|
2026-02-15 10:53:15 +00:00
|
|
|
<li>
|
|
|
|
|
<.link navigate={~p"/admin/providers/new?type=printify"}>Printify</.link>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<.link navigate={~p"/admin/providers/new?type=printful"}>Printful</.link>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2026-02-12 08:35:22 +00:00
|
|
|
</:actions>
|
|
|
|
|
</.header>
|
2026-01-31 22:08:34 +00:00
|
|
|
|
2026-02-12 08:35:22 +00:00
|
|
|
<div id="connections" phx-update="stream" class="mt-6 space-y-4">
|
2026-02-12 14:40:58 +00:00
|
|
|
<div id="connections-empty" class="hidden only:block text-center py-12">
|
2026-02-12 08:35:22 +00:00
|
|
|
<.icon name="hero-cube" class="size-16 mx-auto mb-4 text-base-content/30" />
|
2026-02-15 10:53:15 +00:00
|
|
|
<h2 class="text-xl font-medium">Connect a print-on-demand provider</h2>
|
2026-02-12 08:35:22 +00:00
|
|
|
<p class="mt-2 text-base-content/60 max-w-md mx-auto">
|
2026-02-15 10:53:15 +00:00
|
|
|
Connect your Printify or Printful account to import products
|
|
|
|
|
and start selling.
|
2026-02-12 08:35:22 +00:00
|
|
|
</p>
|
2026-02-15 10:53:15 +00:00
|
|
|
<div class="flex justify-center gap-3 mt-6">
|
|
|
|
|
<.button navigate={~p"/admin/providers/new?type=printify"}>
|
|
|
|
|
Connect Printify
|
|
|
|
|
</.button>
|
2026-02-18 23:55:42 +00:00
|
|
|
<.button navigate={~p"/admin/providers/new?type=printful"} variant="outline">
|
2026-02-15 10:53:15 +00:00
|
|
|
Connect Printful
|
|
|
|
|
</.button>
|
|
|
|
|
</div>
|
2026-02-12 08:35:22 +00:00
|
|
|
</div>
|
2026-01-31 22:08:34 +00:00
|
|
|
|
2026-02-12 08:35:22 +00:00
|
|
|
<div
|
|
|
|
|
:for={{dom_id, connection} <- @streams.connections}
|
|
|
|
|
id={dom_id}
|
2026-02-17 23:05:01 +00:00
|
|
|
class="admin-card"
|
2026-02-12 08:35:22 +00:00
|
|
|
>
|
2026-02-17 23:05:01 +00:00
|
|
|
<div class="admin-card-body">
|
2026-02-12 08:35:22 +00:00
|
|
|
<div class="flex items-start justify-between gap-4">
|
|
|
|
|
<div class="flex-1 min-w-0">
|
2026-01-31 22:08:34 +00:00
|
|
|
<div class="flex items-center gap-2">
|
2026-02-12 08:35:22 +00:00
|
|
|
<.status_indicator status={connection.sync_status} enabled={connection.enabled} />
|
|
|
|
|
<h3 class="font-semibold text-lg">
|
|
|
|
|
{String.capitalize(connection.provider_type)}
|
|
|
|
|
</h3>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="text-base-content/70 mt-1">{connection.name}</p>
|
|
|
|
|
<div class="flex flex-wrap gap-x-4 gap-y-1 mt-2 text-sm text-base-content/60">
|
|
|
|
|
<.connection_info connection={connection} />
|
2026-01-31 22:08:34 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-12 08:35:22 +00:00
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<.link
|
|
|
|
|
navigate={~p"/admin/providers/#{connection.id}/edit"}
|
2026-02-17 23:05:01 +00:00
|
|
|
class="admin-btn admin-btn-ghost admin-btn-sm"
|
2026-02-12 08:35:22 +00:00
|
|
|
>
|
|
|
|
|
Settings
|
|
|
|
|
</.link>
|
2026-01-31 22:08:34 +00:00
|
|
|
<button
|
2026-02-12 08:35:22 +00:00
|
|
|
phx-click="delete"
|
2026-01-31 22:08:34 +00:00
|
|
|
phx-value-id={connection.id}
|
2026-02-15 10:53:15 +00:00
|
|
|
data-confirm={"Disconnect from #{String.capitalize(connection.provider_type)}? Your synced products will remain in your shop."}
|
2026-02-17 23:05:01 +00:00
|
|
|
class="admin-btn admin-btn-ghost admin-btn-sm text-error"
|
2026-01-31 22:08:34 +00:00
|
|
|
>
|
2026-02-12 08:35:22 +00:00
|
|
|
Disconnect
|
2026-01-31 22:08:34 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-12 08:35:22 +00:00
|
|
|
|
2026-02-17 23:05:01 +00:00
|
|
|
<div class="admin-card-actions">
|
2026-02-12 08:35:22 +00:00
|
|
|
<button
|
|
|
|
|
phx-click="sync"
|
|
|
|
|
phx-value-id={connection.id}
|
|
|
|
|
disabled={connection.sync_status == "syncing"}
|
2026-02-17 23:05:01 +00:00
|
|
|
class="admin-btn admin-btn-outline admin-btn-sm"
|
2026-02-12 08:35:22 +00:00
|
|
|
>
|
|
|
|
|
<.icon
|
|
|
|
|
name="hero-arrow-path"
|
|
|
|
|
class={
|
|
|
|
|
if connection.sync_status == "syncing", do: "size-4 animate-spin", else: "size-4"
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
{if connection.sync_status == "syncing", do: "Syncing...", else: "Sync products"}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-01-31 22:08:34 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-12 08:35:22 +00:00
|
|
|
</div>
|