+
+ <.form for={%{}} phx-change="validate" phx-submit="import" class="space-y-4">
+
+ <.live_file_input upload={@uploads.import_file} class="hidden" />
+
+
+ <.icon name="hero-document-arrow-up" class="w-12 h-12 mx-auto text-base-content/40" />
+
+ Drag and drop a JSON file here, or
+
+
+
Max file size: 10MB
+
+
+
+
+ <.icon name="hero-document" class="w-6 h-6 text-primary" />
+ {entry.client_name}
+
+ ({format_bytes(entry.client_size)})
+
+
+
+
+
+
+ {error_to_string(err)}
+
+
+
+
+ <.icon name="hero-check-circle" class="w-5 h-5" />
+ Successfully imported {@import_result.imported} business(es)
+
+
+
0} class="alert alert-warning">
+ <.icon name="hero-exclamation-triangle" class="w-5 h-5" />
+
+
{length(@import_result.errors)} error(s) occurred:
+
+ -
+ Row {index}: {inspect(reason)}
+
+
+
+
+
+
+ <.link navigate={~p"/businesses"} class="btn btn-primary">
+ View Businesses
+
+
+
+
+
+
+ <.icon name="hero-x-circle" class="w-5 h-5" />
+ Import failed: {format_error(@import_result)}
+
+