@spaceinvoices/react-ui 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/common/autocomplete.tsx +69 -6
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +124 -285
- package/src/components/advance-invoices/list/list-table.tsx +10 -3
- package/src/components/advance-invoices/list/locales/de.ts +2 -0
- package/src/components/advance-invoices/list/locales/en.ts +1 -0
- package/src/components/advance-invoices/list/locales/es.ts +1 -0
- package/src/components/advance-invoices/list/locales/fr.ts +1 -0
- package/src/components/advance-invoices/list/locales/hr.ts +1 -0
- package/src/components/advance-invoices/list/locales/it.ts +1 -0
- package/src/components/advance-invoices/list/locales/nl.ts +1 -0
- package/src/components/advance-invoices/list/locales/pl.ts +1 -0
- package/src/components/advance-invoices/list/locales/pt.ts +1 -0
- package/src/components/advance-invoices/list/locales/sl.ts +1 -0
- package/src/components/advance-invoices/list/use-advance-invoice-download.ts +1 -12
- package/src/components/credit-notes/create/create-credit-note-form.tsx +116 -238
- package/src/components/credit-notes/list/list-table.tsx +6 -3
- package/src/components/credit-notes/list/use-credit-note-download.ts +1 -12
- package/src/components/customers/customer-autocomplete.tsx +64 -11
- package/src/components/customers/customer-list-table/customer-list-table.tsx +3 -2
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
- package/src/components/dashboard/collection-rate-card/locales/bg.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/cs.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/et.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/fi.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/is.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/nb.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/sk.ts +3 -0
- package/src/components/dashboard/collection-rate-card/locales/sv.ts +3 -0
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +10 -2
- package/src/components/dashboard/invoice-status-chart/locales/bg.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/cs.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/de.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/es.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/et.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/fi.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/is.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/it.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/nb.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/sk.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/invoice-status-chart/locales/sv.ts +10 -0
- package/src/components/dashboard/payment-methods-chart/locales/bg.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/cs.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/et.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/fi.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/is.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/nb.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/sk.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/sv.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
- package/src/components/dashboard/payment-trend-chart/locales/bg.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/cs.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/de.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/es.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/et.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/fi.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/is.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/it.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/nb.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/sk.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/payment-trend-chart/locales/sv.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +15 -8
- package/src/components/dashboard/revenue-trend-chart/locales/bg.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/cs.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/de.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/es.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/et.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fi.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/is.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/it.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nb.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sk.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sl.ts +1 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sv.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +15 -8
- package/src/components/dashboard/tax-collected-card/locales.ts +110 -0
- package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +8 -2
- package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +4 -4
- package/src/components/dashboard/top-customers-chart/locales/bg.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/cs.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/de.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/es.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/et.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/fi.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/fr.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/hr.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/is.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/it.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/nb.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/nl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/pl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/pt.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/sk.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/sl.ts +2 -0
- package/src/components/dashboard/top-customers-chart/locales/sv.ts +7 -0
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +23 -12
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +33 -20
- package/src/components/delivery-notes/list/list-table.tsx +22 -13
- package/src/components/delivery-notes/list/locales/de.ts +2 -0
- package/src/components/delivery-notes/list/locales/en.ts +1 -0
- package/src/components/delivery-notes/list/locales/es.ts +1 -0
- package/src/components/delivery-notes/list/locales/fr.ts +1 -0
- package/src/components/delivery-notes/list/locales/hr.ts +1 -0
- package/src/components/delivery-notes/list/locales/it.ts +1 -0
- package/src/components/delivery-notes/list/locales/nl.ts +1 -0
- package/src/components/delivery-notes/list/locales/pl.ts +1 -0
- package/src/components/delivery-notes/list/locales/pt.ts +1 -0
- package/src/components/delivery-notes/list/locales/sl.ts +1 -0
- package/src/components/delivery-notes/list/use-delivery-note-download.ts +1 -12
- package/src/components/documents/create/document-add-item-form.tsx +28 -16
- package/src/components/documents/create/document-add-item-tax-rate-field.tsx +12 -2
- package/src/components/documents/create/document-items-section.tsx +70 -39
- package/src/components/documents/create/document-recipient-section.tsx +10 -1
- package/src/components/documents/create/live-preview.tsx +113 -15
- package/src/components/documents/create/prepare-document-submission.ts +35 -16
- package/src/components/documents/create/use-document-customer-form.ts +14 -3
- package/src/components/documents/documents.hooks.ts +7 -2
- package/src/components/documents/shared/document-preview-display.tsx +136 -67
- package/src/components/documents/shared/scaled-document-preview.tsx +45 -5
- package/src/components/documents/view/document-actions-bar.tsx +284 -182
- package/src/components/documents/view/document-activities-list.tsx +3 -0
- package/src/components/documents/view/document-payments-list.tsx +3 -0
- package/src/components/documents/view/locales/de.ts +8 -0
- package/src/components/documents/view/locales/es.ts +8 -0
- package/src/components/documents/view/locales/fr.ts +8 -0
- package/src/components/documents/view/locales/hr.ts +8 -0
- package/src/components/documents/view/locales/it.ts +8 -0
- package/src/components/documents/view/locales/nl.ts +8 -0
- package/src/components/documents/view/locales/pl.ts +8 -0
- package/src/components/documents/view/locales/pt.ts +8 -0
- package/src/components/documents/view/locales/sl.ts +8 -0
- package/src/components/documents/view/use-document-download.ts +14 -25
- package/src/components/entities/create-entity-form.tsx +101 -16
- package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +3 -3
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +78 -124
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +8 -1
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +14 -2
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +7 -2
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +56 -130
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +8 -1
- package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +1 -0
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +15 -2
- package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +20 -3
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +38 -12
- package/src/components/entities/settings/eslog-settings-form.tsx +13 -1
- package/src/components/entities/settings/pdf-template-selector/demo-invoice-data.ts +3 -22
- package/src/components/entities/shared/fiscalization-step-flow.ts +77 -0
- package/src/components/entities/shared/fiscalization-step-tabs.tsx +71 -0
- package/src/components/estimates/create/create-estimate-form.tsx +34 -21
- package/src/components/estimates/list/list-table.tsx +23 -14
- package/src/components/estimates/list/locales/de.ts +2 -0
- package/src/components/estimates/list/locales/en.ts +1 -0
- package/src/components/estimates/list/locales/es.ts +1 -0
- package/src/components/estimates/list/locales/fr.ts +1 -0
- package/src/components/estimates/list/locales/hr.ts +1 -0
- package/src/components/estimates/list/locales/it.ts +1 -0
- package/src/components/estimates/list/locales/nl.ts +1 -0
- package/src/components/estimates/list/locales/pl.ts +1 -0
- package/src/components/estimates/list/locales/pt.ts +1 -0
- package/src/components/estimates/list/locales/sl.ts +1 -0
- package/src/components/estimates/list/use-estimate-download.ts +1 -12
- package/src/components/export/document-export-form.tsx +33 -7
- package/src/components/export/sales-per-item-export-form.tsx +23 -7
- package/src/components/invoices/create/create-invoice-form.tsx +295 -329
- package/src/components/invoices/create/prepare-invoice-submission.ts +0 -8
- package/src/components/invoices/list/list-table.tsx +7 -4
- package/src/components/invoices/list/use-invoice-download.ts +1 -11
- package/src/components/invoices/send-email-dialog/locales/de.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +2 -0
- package/src/components/invoices/send-email-dialog/locales/sl.ts +2 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +77 -8
- package/src/components/invoices/view/eslog-info-display.tsx +17 -1
- package/src/components/invoices/view/fiscalization-status-card.tsx +7 -3
- package/src/components/items/item-combobox.tsx +26 -6
- package/src/components/items/item-list-table/item-list-table.tsx +5 -2
- package/src/components/payments/list/list-table.tsx +14 -4
- package/src/components/recurring-invoices/list/list-table.tsx +7 -4
- package/src/components/request-logs/locales.ts +412 -0
- package/src/components/request-logs/request-log-detail.tsx +37 -21
- package/src/components/request-logs/request-log-list-table.tsx +57 -11
- package/src/components/table/data-table.tsx +5 -2
- package/src/components/table/date-cell.tsx +3 -1
- package/src/components/table/filter-bar.tsx +14 -2
- package/src/components/table/hooks/use-table-query.ts +1 -1
- package/src/components/table/locales.ts +1116 -0
- package/src/components/table/search-input.tsx +12 -3
- package/src/components/table/selection-toolbar.tsx +23 -6
- package/src/components/table/table-empty-state.tsx +43 -3
- package/src/components/table/table-no-results.tsx +3 -3
- package/src/components/table/table-pagination.tsx +4 -3
- package/src/components/table/types.ts +1 -0
- package/src/components/tax-reports/index.ts +1 -0
- package/src/components/tax-reports/kir-export-form.tsx +46 -8
- package/src/components/tax-reports/slovenia-tax-profile-step.tsx +191 -0
- package/src/components/tax-reports/slovenia-yearly-export-form.tsx +509 -0
- package/src/components/tax-reports/slovenia-yearly-review-step.tsx +253 -0
- package/src/components/tax-reports/slovenia-yearly-summary.tsx +19 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -2
- package/src/components/ui/sticky-form-footer.tsx +7 -1
- package/src/components/webhook-logs/index.ts +6 -0
- package/src/components/webhook-logs/locales.ts +392 -0
- package/src/components/webhook-logs/webhook-delivery-detail.tsx +255 -0
- package/src/components/webhook-logs/webhook-delivery-list-table.tsx +278 -0
- package/src/components/wl-subscription/index.ts +1 -0
- package/src/components/wl-subscription/locked-feature.tsx +1 -0
- package/src/components/wl-subscription/paywall.tsx +193 -0
- package/src/components/wl-subscription/upgrade-modal.tsx +93 -29
- package/src/generate-schemas.ts +10 -5
- package/src/generated/schemas/customer.ts +2 -0
- package/src/generated/schemas/entity.ts +34 -0
- package/src/generated/schemas/me.ts +20 -1
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +40 -34
- package/src/generated/schemas/rendercreditnotepreview_body.ts +42 -36
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +23 -13
- package/src/generated/schemas/renderestimatepreview_body.ts +23 -13
- package/src/generated/schemas/renderinvoicepreview_body.ts +40 -34
- package/src/generated/schemas/sendemail_body.ts +44 -0
- package/src/generated/schemas/startpdfexport_body.ts +91 -1
- package/src/generated/schemas/webhook.ts +10 -0
- package/src/hooks/use-duplicate-document.ts +51 -13
- package/src/hooks/use-eslog-validation.ts +59 -0
- package/src/hooks/use-premise-selection.ts +186 -0
- package/src/lib/browser-cookies.ts +4 -4
- package/src/lib/date-fns-locale.ts +48 -0
- package/src/lib/fiscalization-options.ts +81 -0
- package/src/lib/locale.ts +38 -0
- package/src/lib/template-variables.tsx +1 -1
- package/src/lib/translation.ts +14 -3
- package/src/providers/entities-context.tsx +1 -0
- package/src/providers/entities-provider.tsx +102 -3
- package/src/providers/form-footer-context.tsx +37 -4
- package/src/providers/sdk-provider.tsx +7 -2
- package/src/providers/white-label-provider.tsx +4 -1
- package/src/providers/wl-subscription-provider.tsx +90 -3
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"Search...": "Search...",
|
|
3
|
+
Search: "Search",
|
|
4
|
+
"Clear search": "Clear search",
|
|
5
|
+
Filters: "Filters",
|
|
6
|
+
"Clear filters": "Clear filters",
|
|
7
|
+
"Date Range": "Date Range",
|
|
8
|
+
From: "From",
|
|
9
|
+
To: "To",
|
|
10
|
+
Status: "Status",
|
|
11
|
+
Date: "Date",
|
|
12
|
+
Event: "Event",
|
|
13
|
+
URL: "URL",
|
|
14
|
+
Entity: "Entity",
|
|
15
|
+
Duration: "Duration",
|
|
16
|
+
Time: "Time",
|
|
17
|
+
Attempt: "Attempt",
|
|
18
|
+
Request: "Request",
|
|
19
|
+
Response: "Response",
|
|
20
|
+
"Request body": "Request body",
|
|
21
|
+
"Delivery ID": "Delivery ID",
|
|
22
|
+
Copy: "Copy",
|
|
23
|
+
"Copy to clipboard": "Copy to clipboard",
|
|
24
|
+
success: "Success",
|
|
25
|
+
failed: "Failed",
|
|
26
|
+
pending: "Pending",
|
|
27
|
+
"No request body data": "No request body data",
|
|
28
|
+
"No response data": "No response data",
|
|
29
|
+
"No results found": "No results found",
|
|
30
|
+
"Try adjusting your search criteria": "Try adjusting your search criteria",
|
|
31
|
+
"Your list is empty": "Your list is empty",
|
|
32
|
+
"Get started by creating your first entry": "Get started by creating your first entry",
|
|
33
|
+
"Create new": "Create new",
|
|
34
|
+
"Clear all": "Clear all",
|
|
35
|
+
"Previous page": "Previous page",
|
|
36
|
+
"Next page": "Next page",
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
const sl = {
|
|
40
|
+
"Search...": "Išči...",
|
|
41
|
+
Search: "Išči",
|
|
42
|
+
"Clear search": "Počisti iskanje",
|
|
43
|
+
Filters: "Filtri",
|
|
44
|
+
"Clear filters": "Počisti filtre",
|
|
45
|
+
"Date Range": "Datumski razpon",
|
|
46
|
+
From: "Od",
|
|
47
|
+
To: "Do",
|
|
48
|
+
Status: "Status",
|
|
49
|
+
Date: "Datum",
|
|
50
|
+
Event: "Dogodek",
|
|
51
|
+
URL: "URL",
|
|
52
|
+
Entity: "Entiteta",
|
|
53
|
+
Duration: "Trajanje",
|
|
54
|
+
Time: "Čas",
|
|
55
|
+
Attempt: "Poskus",
|
|
56
|
+
Request: "Zahteva",
|
|
57
|
+
Response: "Odgovor",
|
|
58
|
+
"Request body": "Telo zahteve",
|
|
59
|
+
"Delivery ID": "ID dostave",
|
|
60
|
+
Copy: "Kopiraj",
|
|
61
|
+
"Copy to clipboard": "Kopirano v odložišče",
|
|
62
|
+
success: "Uspešno",
|
|
63
|
+
failed: "Neuspešno",
|
|
64
|
+
pending: "V teku",
|
|
65
|
+
"No request body data": "Ni podatkov telesa zahteve",
|
|
66
|
+
"No response data": "Ni podatkov odgovora",
|
|
67
|
+
"No results found": "Ni rezultatov",
|
|
68
|
+
"Try adjusting your search criteria": "Poskusite prilagoditi iskalne pogoje",
|
|
69
|
+
"Your list is empty": "Seznam je prazen",
|
|
70
|
+
"Get started by creating your first entry": "Začnite z ustvarjanjem prvega vnosa",
|
|
71
|
+
"Create new": "Ustvari novo",
|
|
72
|
+
"Clear all": "Počisti vse",
|
|
73
|
+
"Previous page": "Prejšnja stran",
|
|
74
|
+
"Next page": "Naslednja stran",
|
|
75
|
+
} as const;
|
|
76
|
+
|
|
77
|
+
const de = {
|
|
78
|
+
"Search...": "Suchen...",
|
|
79
|
+
Search: "Suchen",
|
|
80
|
+
"Clear search": "Suche löschen",
|
|
81
|
+
Filters: "Filter",
|
|
82
|
+
"Clear filters": "Filter löschen",
|
|
83
|
+
"Date Range": "Datumsbereich",
|
|
84
|
+
From: "Von",
|
|
85
|
+
To: "Bis",
|
|
86
|
+
Status: "Status",
|
|
87
|
+
Date: "Datum",
|
|
88
|
+
Event: "Ereignis",
|
|
89
|
+
URL: "URL",
|
|
90
|
+
Entity: "Entität",
|
|
91
|
+
Duration: "Dauer",
|
|
92
|
+
Time: "Zeit",
|
|
93
|
+
Attempt: "Versuch",
|
|
94
|
+
Request: "Anfrage",
|
|
95
|
+
Response: "Antwort",
|
|
96
|
+
"Request body": "Request-Body",
|
|
97
|
+
"Delivery ID": "Delivery-ID",
|
|
98
|
+
Copy: "Kopieren",
|
|
99
|
+
"Copy to clipboard": "In die Zwischenablage kopieren",
|
|
100
|
+
success: "Erfolgreich",
|
|
101
|
+
failed: "Fehlgeschlagen",
|
|
102
|
+
pending: "Ausstehend",
|
|
103
|
+
"No request body data": "Keine Request-Body-Daten",
|
|
104
|
+
"No response data": "Keine Response-Daten",
|
|
105
|
+
"No results found": "Keine Ergebnisse gefunden",
|
|
106
|
+
"Try adjusting your search criteria": "Versuchen Sie, Ihre Suchkriterien anzupassen",
|
|
107
|
+
"Your list is empty": "Ihre Liste ist leer",
|
|
108
|
+
"Get started by creating your first entry": "Erstellen Sie Ihren ersten Eintrag",
|
|
109
|
+
"Create new": "Neu erstellen",
|
|
110
|
+
"Clear all": "Alles löschen",
|
|
111
|
+
"Previous page": "Vorherige Seite",
|
|
112
|
+
"Next page": "Nächste Seite",
|
|
113
|
+
} as const;
|
|
114
|
+
|
|
115
|
+
const it = {
|
|
116
|
+
"Search...": "Cerca...",
|
|
117
|
+
Search: "Cerca",
|
|
118
|
+
"Clear search": "Cancella ricerca",
|
|
119
|
+
Filters: "Filtri",
|
|
120
|
+
"Clear filters": "Cancella filtri",
|
|
121
|
+
"Date Range": "Intervallo di date",
|
|
122
|
+
From: "Da",
|
|
123
|
+
To: "A",
|
|
124
|
+
Status: "Stato",
|
|
125
|
+
Date: "Data",
|
|
126
|
+
Event: "Evento",
|
|
127
|
+
URL: "URL",
|
|
128
|
+
Entity: "Entità",
|
|
129
|
+
Duration: "Durata",
|
|
130
|
+
Time: "Ora",
|
|
131
|
+
Attempt: "Tentativo",
|
|
132
|
+
Request: "Richiesta",
|
|
133
|
+
Response: "Risposta",
|
|
134
|
+
"Request body": "Corpo della richiesta",
|
|
135
|
+
"Delivery ID": "ID consegna",
|
|
136
|
+
Copy: "Copia",
|
|
137
|
+
"Copy to clipboard": "Copia negli appunti",
|
|
138
|
+
success: "Riuscito",
|
|
139
|
+
failed: "Non riuscito",
|
|
140
|
+
pending: "In attesa",
|
|
141
|
+
"No request body data": "Nessun dato del corpo della richiesta",
|
|
142
|
+
"No response data": "Nessun dato della risposta",
|
|
143
|
+
"No results found": "Nessun risultato trovato",
|
|
144
|
+
"Try adjusting your search criteria": "Prova a modificare i criteri di ricerca",
|
|
145
|
+
"Your list is empty": "La tua lista è vuota",
|
|
146
|
+
"Get started by creating your first entry": "Inizia creando il tuo primo elemento",
|
|
147
|
+
"Create new": "Crea nuovo",
|
|
148
|
+
"Clear all": "Cancella tutto",
|
|
149
|
+
"Previous page": "Pagina precedente",
|
|
150
|
+
"Next page": "Pagina successiva",
|
|
151
|
+
} as const;
|
|
152
|
+
|
|
153
|
+
const fr = {
|
|
154
|
+
"Search...": "Rechercher...",
|
|
155
|
+
Search: "Rechercher",
|
|
156
|
+
"Clear search": "Effacer la recherche",
|
|
157
|
+
Filters: "Filtres",
|
|
158
|
+
"Clear filters": "Effacer les filtres",
|
|
159
|
+
"Date Range": "Plage de dates",
|
|
160
|
+
From: "De",
|
|
161
|
+
To: "À",
|
|
162
|
+
Status: "Statut",
|
|
163
|
+
Date: "Date",
|
|
164
|
+
Event: "Événement",
|
|
165
|
+
URL: "URL",
|
|
166
|
+
Entity: "Entité",
|
|
167
|
+
Duration: "Durée",
|
|
168
|
+
Time: "Heure",
|
|
169
|
+
Attempt: "Tentative",
|
|
170
|
+
Request: "Requête",
|
|
171
|
+
Response: "Réponse",
|
|
172
|
+
"Request body": "Corps de requête",
|
|
173
|
+
"Delivery ID": "ID de livraison",
|
|
174
|
+
Copy: "Copier",
|
|
175
|
+
"Copy to clipboard": "Copier dans le presse-papiers",
|
|
176
|
+
success: "Réussi",
|
|
177
|
+
failed: "Échoué",
|
|
178
|
+
pending: "En attente",
|
|
179
|
+
"No request body data": "Aucune donnée de corps de requête",
|
|
180
|
+
"No response data": "Aucune donnée de réponse",
|
|
181
|
+
"No results found": "Aucun résultat trouvé",
|
|
182
|
+
"Try adjusting your search criteria": "Essayez d'ajuster vos critères de recherche",
|
|
183
|
+
"Your list is empty": "Votre liste est vide",
|
|
184
|
+
"Get started by creating your first entry": "Commencez par créer votre première entrée",
|
|
185
|
+
"Create new": "Créer",
|
|
186
|
+
"Clear all": "Tout effacer",
|
|
187
|
+
"Previous page": "Page précédente",
|
|
188
|
+
"Next page": "Page suivante",
|
|
189
|
+
} as const;
|
|
190
|
+
|
|
191
|
+
const es = {
|
|
192
|
+
"Search...": "Buscar...",
|
|
193
|
+
Search: "Buscar",
|
|
194
|
+
"Clear search": "Borrar búsqueda",
|
|
195
|
+
Filters: "Filtros",
|
|
196
|
+
"Clear filters": "Limpiar filtros",
|
|
197
|
+
"Date Range": "Rango de fechas",
|
|
198
|
+
From: "Desde",
|
|
199
|
+
To: "Hasta",
|
|
200
|
+
Status: "Estado",
|
|
201
|
+
Date: "Fecha",
|
|
202
|
+
Event: "Evento",
|
|
203
|
+
URL: "URL",
|
|
204
|
+
Entity: "Entidad",
|
|
205
|
+
Duration: "Duración",
|
|
206
|
+
Time: "Hora",
|
|
207
|
+
Attempt: "Intento",
|
|
208
|
+
Request: "Solicitud",
|
|
209
|
+
Response: "Respuesta",
|
|
210
|
+
"Request body": "Cuerpo de la solicitud",
|
|
211
|
+
"Delivery ID": "ID de entrega",
|
|
212
|
+
Copy: "Copiar",
|
|
213
|
+
"Copy to clipboard": "Copiar al portapapeles",
|
|
214
|
+
success: "Exitosa",
|
|
215
|
+
failed: "Fallida",
|
|
216
|
+
pending: "Pendiente",
|
|
217
|
+
"No request body data": "Sin datos del cuerpo de la solicitud",
|
|
218
|
+
"No response data": "Sin datos de respuesta",
|
|
219
|
+
"No results found": "No se encontraron resultados",
|
|
220
|
+
"Try adjusting your search criteria": "Prueba a ajustar tus criterios de búsqueda",
|
|
221
|
+
"Your list is empty": "Tu lista está vacía",
|
|
222
|
+
"Get started by creating your first entry": "Empieza creando tu primera entrada",
|
|
223
|
+
"Create new": "Crear nuevo",
|
|
224
|
+
"Clear all": "Limpiar todo",
|
|
225
|
+
"Previous page": "Página anterior",
|
|
226
|
+
"Next page": "Página siguiente",
|
|
227
|
+
} as const;
|
|
228
|
+
|
|
229
|
+
const pt = {
|
|
230
|
+
"Search...": "Pesquisar...",
|
|
231
|
+
Search: "Pesquisar",
|
|
232
|
+
"Clear search": "Limpar pesquisa",
|
|
233
|
+
Filters: "Filtros",
|
|
234
|
+
"Clear filters": "Limpar filtros",
|
|
235
|
+
"Date Range": "Intervalo de datas",
|
|
236
|
+
From: "De",
|
|
237
|
+
To: "Até",
|
|
238
|
+
Status: "Estado",
|
|
239
|
+
Date: "Data",
|
|
240
|
+
Event: "Evento",
|
|
241
|
+
URL: "URL",
|
|
242
|
+
Entity: "Entidade",
|
|
243
|
+
Duration: "Duração",
|
|
244
|
+
Time: "Hora",
|
|
245
|
+
Attempt: "Tentativa",
|
|
246
|
+
Request: "Pedido",
|
|
247
|
+
Response: "Resposta",
|
|
248
|
+
"Request body": "Corpo do pedido",
|
|
249
|
+
"Delivery ID": "ID da entrega",
|
|
250
|
+
Copy: "Copiar",
|
|
251
|
+
"Copy to clipboard": "Copiar para a área de transferência",
|
|
252
|
+
success: "Bem-sucedido",
|
|
253
|
+
failed: "Falhou",
|
|
254
|
+
pending: "Pendente",
|
|
255
|
+
"No request body data": "Sem dados do corpo do pedido",
|
|
256
|
+
"No response data": "Sem dados de resposta",
|
|
257
|
+
"No results found": "Nenhum resultado encontrado",
|
|
258
|
+
"Try adjusting your search criteria": "Tente ajustar os seus critérios de pesquisa",
|
|
259
|
+
"Your list is empty": "A sua lista está vazia",
|
|
260
|
+
"Get started by creating your first entry": "Comece por criar a sua primeira entrada",
|
|
261
|
+
"Create new": "Criar novo",
|
|
262
|
+
"Clear all": "Limpar tudo",
|
|
263
|
+
"Previous page": "Página anterior",
|
|
264
|
+
"Next page": "Página seguinte",
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
267
|
+
const nl = {
|
|
268
|
+
"Search...": "Zoeken...",
|
|
269
|
+
Search: "Zoeken",
|
|
270
|
+
"Clear search": "Zoekopdracht wissen",
|
|
271
|
+
Filters: "Filters",
|
|
272
|
+
"Clear filters": "Filters wissen",
|
|
273
|
+
"Date Range": "Datumbereik",
|
|
274
|
+
From: "Van",
|
|
275
|
+
To: "Tot",
|
|
276
|
+
Status: "Status",
|
|
277
|
+
Date: "Datum",
|
|
278
|
+
Event: "Gebeurtenis",
|
|
279
|
+
URL: "URL",
|
|
280
|
+
Entity: "Entiteit",
|
|
281
|
+
Duration: "Duur",
|
|
282
|
+
Time: "Tijd",
|
|
283
|
+
Attempt: "Poging",
|
|
284
|
+
Request: "Verzoek",
|
|
285
|
+
Response: "Respons",
|
|
286
|
+
"Request body": "Request-body",
|
|
287
|
+
"Delivery ID": "Delivery-ID",
|
|
288
|
+
Copy: "Kopiëren",
|
|
289
|
+
"Copy to clipboard": "Kopiëren naar klembord",
|
|
290
|
+
success: "Geslaagd",
|
|
291
|
+
failed: "Mislukt",
|
|
292
|
+
pending: "In behandeling",
|
|
293
|
+
"No request body data": "Geen gegevens in request-body",
|
|
294
|
+
"No response data": "Geen responsgegevens",
|
|
295
|
+
"No results found": "Geen resultaten gevonden",
|
|
296
|
+
"Try adjusting your search criteria": "Probeer je zoekcriteria aan te passen",
|
|
297
|
+
"Your list is empty": "Je lijst is leeg",
|
|
298
|
+
"Get started by creating your first entry": "Begin met het maken van je eerste item",
|
|
299
|
+
"Create new": "Nieuw maken",
|
|
300
|
+
"Clear all": "Alles wissen",
|
|
301
|
+
"Previous page": "Vorige pagina",
|
|
302
|
+
"Next page": "Volgende pagina",
|
|
303
|
+
} as const;
|
|
304
|
+
|
|
305
|
+
const pl = {
|
|
306
|
+
"Search...": "Szukaj...",
|
|
307
|
+
Search: "Szukaj",
|
|
308
|
+
"Clear search": "Wyczyść wyszukiwanie",
|
|
309
|
+
Filters: "Filtry",
|
|
310
|
+
"Clear filters": "Wyczyść filtry",
|
|
311
|
+
"Date Range": "Zakres dat",
|
|
312
|
+
From: "Od",
|
|
313
|
+
To: "Do",
|
|
314
|
+
Status: "Status",
|
|
315
|
+
Date: "Data",
|
|
316
|
+
Event: "Zdarzenie",
|
|
317
|
+
URL: "URL",
|
|
318
|
+
Entity: "Encja",
|
|
319
|
+
Duration: "Czas trwania",
|
|
320
|
+
Time: "Czas",
|
|
321
|
+
Attempt: "Próba",
|
|
322
|
+
Request: "Żądanie",
|
|
323
|
+
Response: "Odpowiedź",
|
|
324
|
+
"Request body": "Treść żądania",
|
|
325
|
+
"Delivery ID": "ID dostawy",
|
|
326
|
+
Copy: "Kopiuj",
|
|
327
|
+
"Copy to clipboard": "Kopiuj do schowka",
|
|
328
|
+
success: "Sukces",
|
|
329
|
+
failed: "Niepowodzenie",
|
|
330
|
+
pending: "Oczekujące",
|
|
331
|
+
"No request body data": "Brak danych treści żądania",
|
|
332
|
+
"No response data": "Brak danych odpowiedzi",
|
|
333
|
+
"No results found": "Nie znaleziono wyników",
|
|
334
|
+
"Try adjusting your search criteria": "Spróbuj dostosować kryteria wyszukiwania",
|
|
335
|
+
"Your list is empty": "Twoja lista jest pusta",
|
|
336
|
+
"Get started by creating your first entry": "Zacznij od utworzenia pierwszego wpisu",
|
|
337
|
+
"Create new": "Utwórz nowy",
|
|
338
|
+
"Clear all": "Wyczyść wszystko",
|
|
339
|
+
"Previous page": "Poprzednia strona",
|
|
340
|
+
"Next page": "Następna strona",
|
|
341
|
+
} as const;
|
|
342
|
+
|
|
343
|
+
const hr = {
|
|
344
|
+
"Search...": "Pretraži...",
|
|
345
|
+
Search: "Pretraži",
|
|
346
|
+
"Clear search": "Očisti pretragu",
|
|
347
|
+
Filters: "Filtri",
|
|
348
|
+
"Clear filters": "Očisti filtre",
|
|
349
|
+
"Date Range": "Datumski raspon",
|
|
350
|
+
From: "Od",
|
|
351
|
+
To: "Do",
|
|
352
|
+
Status: "Status",
|
|
353
|
+
Date: "Datum",
|
|
354
|
+
Event: "Događaj",
|
|
355
|
+
URL: "URL",
|
|
356
|
+
Entity: "Entitet",
|
|
357
|
+
Duration: "Trajanje",
|
|
358
|
+
Time: "Vrijeme",
|
|
359
|
+
Attempt: "Pokušaj",
|
|
360
|
+
Request: "Zahtjev",
|
|
361
|
+
Response: "Odgovor",
|
|
362
|
+
"Request body": "Tijelo zahtjeva",
|
|
363
|
+
"Delivery ID": "ID isporuke",
|
|
364
|
+
Copy: "Kopiraj",
|
|
365
|
+
"Copy to clipboard": "Kopiraj u međuspremnik",
|
|
366
|
+
success: "Uspješno",
|
|
367
|
+
failed: "Neuspješno",
|
|
368
|
+
pending: "Na čekanju",
|
|
369
|
+
"No request body data": "Nema podataka tijela zahtjeva",
|
|
370
|
+
"No response data": "Nema podataka odgovora",
|
|
371
|
+
"No results found": "Nema rezultata",
|
|
372
|
+
"Try adjusting your search criteria": "Pokušajte prilagoditi kriterije pretrage",
|
|
373
|
+
"Your list is empty": "Vaš popis je prazan",
|
|
374
|
+
"Get started by creating your first entry": "Započnite stvaranjem prve stavke",
|
|
375
|
+
"Create new": "Stvori novo",
|
|
376
|
+
"Clear all": "Očisti sve",
|
|
377
|
+
"Previous page": "Prethodna stranica",
|
|
378
|
+
"Next page": "Sljedeća stranica",
|
|
379
|
+
} as const;
|
|
380
|
+
|
|
381
|
+
export default {
|
|
382
|
+
en,
|
|
383
|
+
sl,
|
|
384
|
+
de,
|
|
385
|
+
it,
|
|
386
|
+
fr,
|
|
387
|
+
es,
|
|
388
|
+
pt,
|
|
389
|
+
nl,
|
|
390
|
+
pl,
|
|
391
|
+
hr,
|
|
392
|
+
} as const;
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { format, formatDistanceToNow } from "date-fns";
|
|
4
|
+
import { AlertCircle, Check, Copy } from "lucide-react";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Alert, AlertDescription } from "@/ui/components/ui/alert";
|
|
7
|
+
import { Button } from "@/ui/components/ui/button";
|
|
8
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/ui/components/ui/tabs";
|
|
9
|
+
import { getDateFnsLocale } from "@/ui/lib/date-fns-locale";
|
|
10
|
+
import { cn } from "../../lib/utils";
|
|
11
|
+
import type { WebhookDeliveryResponse } from "./webhook-delivery-list-table";
|
|
12
|
+
|
|
13
|
+
type TranslationFn = (key: string) => string;
|
|
14
|
+
|
|
15
|
+
const defaultT: TranslationFn = (key) => key;
|
|
16
|
+
|
|
17
|
+
export interface WebhookDeliveryDetailProps {
|
|
18
|
+
delivery: WebhookDeliveryResponse;
|
|
19
|
+
t?: TranslationFn;
|
|
20
|
+
/** Locale used for relative date formatting */
|
|
21
|
+
locale?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function JsonViewer({ data, noDataLabel, t }: { data: unknown; noDataLabel: string; t: TranslationFn }) {
|
|
25
|
+
const [copied, setCopied] = useState(false);
|
|
26
|
+
const jsonString = data ? JSON.stringify(data, null, 2) : null;
|
|
27
|
+
|
|
28
|
+
const handleCopy = async () => {
|
|
29
|
+
if (jsonString) {
|
|
30
|
+
await navigator.clipboard.writeText(jsonString);
|
|
31
|
+
setCopied(true);
|
|
32
|
+
setTimeout(() => setCopied(false), 2000);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
if (!data || (typeof data === "object" && Object.keys(data as Record<string, unknown>).length === 0)) {
|
|
37
|
+
return (
|
|
38
|
+
<div className="rounded-lg border bg-muted/30 p-4 text-center text-muted-foreground text-sm">
|
|
39
|
+
{t(noDataLabel)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="relative">
|
|
46
|
+
<Button
|
|
47
|
+
variant="ghost"
|
|
48
|
+
size="sm"
|
|
49
|
+
className="absolute top-2 right-2 h-8 w-8 p-0"
|
|
50
|
+
onClick={handleCopy}
|
|
51
|
+
title={t("Copy to clipboard")}
|
|
52
|
+
>
|
|
53
|
+
{copied ? <Check className="h-4 w-4 text-green-500" /> : <Copy className="h-4 w-4" />}
|
|
54
|
+
</Button>
|
|
55
|
+
<pre className="overflow-x-auto rounded-lg border bg-muted/30 p-4 font-mono text-sm">
|
|
56
|
+
<JsonHighlight json={jsonString ?? ""} />
|
|
57
|
+
</pre>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function JsonHighlight({ json }: { json: string }) {
|
|
63
|
+
const tokens: { type: string; value: string }[] = [];
|
|
64
|
+
const lines = json.split("\n");
|
|
65
|
+
|
|
66
|
+
for (const line of lines) {
|
|
67
|
+
const keyMatch = line.match(/^(\s*)"([^"]+)":/);
|
|
68
|
+
if (keyMatch) {
|
|
69
|
+
const [, indent, key] = keyMatch;
|
|
70
|
+
const rest = line.slice(keyMatch[0].length);
|
|
71
|
+
tokens.push({ type: "indent", value: indent });
|
|
72
|
+
tokens.push({ type: "key", value: `"${key}"` });
|
|
73
|
+
tokens.push({ type: "punctuation", value: ":" });
|
|
74
|
+
|
|
75
|
+
const valueMatch = rest.match(/^\s*(.+?)(,?)$/);
|
|
76
|
+
if (valueMatch) {
|
|
77
|
+
const [, value, comma] = valueMatch;
|
|
78
|
+
tokens.push({ type: "space", value: " " });
|
|
79
|
+
if (value.startsWith('"')) {
|
|
80
|
+
tokens.push({ type: "string", value: value.replace(/,$/, "") });
|
|
81
|
+
} else if (value === "true" || value === "false") {
|
|
82
|
+
tokens.push({ type: "boolean", value });
|
|
83
|
+
} else if (value === "null") {
|
|
84
|
+
tokens.push({ type: "null", value });
|
|
85
|
+
} else if (!Number.isNaN(Number(value.replace(/,$/, "")))) {
|
|
86
|
+
tokens.push({ type: "number", value: value.replace(/,$/, "") });
|
|
87
|
+
} else {
|
|
88
|
+
tokens.push({ type: "other", value: value.replace(/,$/, "") });
|
|
89
|
+
}
|
|
90
|
+
if (comma) tokens.push({ type: "punctuation", value: comma });
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
tokens.push({ type: "other", value: line });
|
|
94
|
+
}
|
|
95
|
+
tokens.push({ type: "newline", value: "\n" });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const colorMap: Record<string, string> = {
|
|
99
|
+
key: "text-blue-600 dark:text-blue-400",
|
|
100
|
+
string: "text-green-600 dark:text-green-400",
|
|
101
|
+
number: "text-orange-600 dark:text-orange-400",
|
|
102
|
+
boolean: "text-purple-600 dark:text-purple-400",
|
|
103
|
+
null: "text-gray-500",
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<code>
|
|
108
|
+
{tokens.map((token, i) => (
|
|
109
|
+
<span key={`${i}-${token.type}`} className={colorMap[token.type] || ""}>
|
|
110
|
+
{token.value}
|
|
111
|
+
</span>
|
|
112
|
+
))}
|
|
113
|
+
</code>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const STATUS_STYLES: Record<string, { color: string; bg: string }> = {
|
|
118
|
+
success: {
|
|
119
|
+
color: "text-green-700 dark:text-green-400",
|
|
120
|
+
bg: "bg-green-100 dark:bg-green-900",
|
|
121
|
+
},
|
|
122
|
+
failed: {
|
|
123
|
+
color: "text-red-700 dark:text-red-400",
|
|
124
|
+
bg: "bg-red-100 dark:bg-red-900",
|
|
125
|
+
},
|
|
126
|
+
pending: {
|
|
127
|
+
color: "text-yellow-700 dark:text-yellow-400",
|
|
128
|
+
bg: "bg-yellow-100 dark:bg-yellow-900",
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export function WebhookDeliveryDetail({ delivery, t = defaultT, locale }: WebhookDeliveryDetailProps) {
|
|
133
|
+
const createdAt = new Date(delivery.created_at);
|
|
134
|
+
const dateLocale = getDateFnsLocale(locale);
|
|
135
|
+
const styles = STATUS_STYLES[delivery.status] ?? {
|
|
136
|
+
color: "text-gray-500",
|
|
137
|
+
bg: "bg-gray-100 dark:bg-gray-800",
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div className="space-y-6 p-4 pt-6">
|
|
142
|
+
{/* Summary */}
|
|
143
|
+
<div className="flex flex-wrap items-center gap-4">
|
|
144
|
+
<span className={cn("rounded-md px-2.5 py-1 font-medium text-sm capitalize", styles.bg, styles.color)}>
|
|
145
|
+
{t(delivery.status)}
|
|
146
|
+
</span>
|
|
147
|
+
<div className="text-muted-foreground text-sm">
|
|
148
|
+
<time dateTime={delivery.created_at} title={format(createdAt, "PPpp")}>
|
|
149
|
+
{formatDistanceToNow(createdAt, { addSuffix: true, locale: dateLocale })}
|
|
150
|
+
</time>
|
|
151
|
+
<span className="mx-2">•</span>
|
|
152
|
+
<span>{format(createdAt, "PPpp")}</span>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
{/* Metadata */}
|
|
157
|
+
<div className="flex flex-wrap gap-4 text-sm">
|
|
158
|
+
<div>
|
|
159
|
+
<span className="text-muted-foreground">{t("Event")}:</span>{" "}
|
|
160
|
+
<span className="font-medium">{delivery.event_type}</span>
|
|
161
|
+
</div>
|
|
162
|
+
{delivery.webhook_url && (
|
|
163
|
+
<div>
|
|
164
|
+
<span className="text-muted-foreground">{t("URL")}:</span>{" "}
|
|
165
|
+
<code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">{delivery.webhook_url}</code>
|
|
166
|
+
</div>
|
|
167
|
+
)}
|
|
168
|
+
<div>
|
|
169
|
+
<span className="text-muted-foreground">{t("Attempt")}:</span>{" "}
|
|
170
|
+
<span className="font-medium">
|
|
171
|
+
{delivery.attempt}/{delivery.max_attempts}
|
|
172
|
+
</span>
|
|
173
|
+
</div>
|
|
174
|
+
{delivery.duration_ms != null && (
|
|
175
|
+
<div>
|
|
176
|
+
<span className="text-muted-foreground">{t("Duration")}:</span>{" "}
|
|
177
|
+
<span className="font-medium">{delivery.duration_ms}ms</span>
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
180
|
+
{delivery.response_status != null && (
|
|
181
|
+
<div>
|
|
182
|
+
<span className="text-muted-foreground">{t("Response")}:</span>{" "}
|
|
183
|
+
<span className="font-medium">{delivery.response_status}</span>
|
|
184
|
+
</div>
|
|
185
|
+
)}
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
{/* Error message */}
|
|
189
|
+
{delivery.error_message && (
|
|
190
|
+
<Alert variant="destructive">
|
|
191
|
+
<AlertCircle className="h-4 w-4" />
|
|
192
|
+
<AlertDescription>{delivery.error_message}</AlertDescription>
|
|
193
|
+
</Alert>
|
|
194
|
+
)}
|
|
195
|
+
|
|
196
|
+
{/* Tabs for Request Body / Response */}
|
|
197
|
+
<Tabs defaultValue="request" className="w-full">
|
|
198
|
+
<TabsList className="grid w-full grid-cols-2">
|
|
199
|
+
<TabsTrigger value="request">{t("Request body")}</TabsTrigger>
|
|
200
|
+
<TabsTrigger value="response">{t("Response")}</TabsTrigger>
|
|
201
|
+
</TabsList>
|
|
202
|
+
<TabsContent value="request" className="mt-4">
|
|
203
|
+
<JsonViewer data={delivery.request_body} noDataLabel="No request body data" t={t} />
|
|
204
|
+
</TabsContent>
|
|
205
|
+
<TabsContent value="response" className="mt-4">
|
|
206
|
+
{delivery.response_body ? (
|
|
207
|
+
<div className="space-y-2">
|
|
208
|
+
{delivery.response_status != null && (
|
|
209
|
+
<div className="text-muted-foreground text-sm">
|
|
210
|
+
{t("Status")}: <span className="font-medium font-mono">{delivery.response_status}</span>
|
|
211
|
+
</div>
|
|
212
|
+
)}
|
|
213
|
+
<pre className="overflow-x-auto rounded-lg border bg-muted/30 p-4 font-mono text-sm">
|
|
214
|
+
{delivery.response_body}
|
|
215
|
+
</pre>
|
|
216
|
+
</div>
|
|
217
|
+
) : (
|
|
218
|
+
<div className="rounded-lg border bg-muted/30 p-4 text-center text-muted-foreground text-sm">
|
|
219
|
+
{t("No response data")}
|
|
220
|
+
</div>
|
|
221
|
+
)}
|
|
222
|
+
</TabsContent>
|
|
223
|
+
</Tabs>
|
|
224
|
+
|
|
225
|
+
{/* Delivery ID */}
|
|
226
|
+
<DeliveryIdDisplay deliveryId={delivery.id} t={t} />
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function DeliveryIdDisplay({ deliveryId, t }: { deliveryId: string; t: TranslationFn }) {
|
|
232
|
+
const [copied, setCopied] = useState(false);
|
|
233
|
+
|
|
234
|
+
const handleCopy = async () => {
|
|
235
|
+
await navigator.clipboard.writeText(deliveryId);
|
|
236
|
+
setCopied(true);
|
|
237
|
+
setTimeout(() => setCopied(false), 2000);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<div className="flex items-center gap-2 border-t pt-4 text-muted-foreground text-xs">
|
|
242
|
+
<span>{t("Delivery ID")}:</span>
|
|
243
|
+
<code className="font-mono">{deliveryId}</code>
|
|
244
|
+
<Button
|
|
245
|
+
variant="ghost"
|
|
246
|
+
size="sm"
|
|
247
|
+
className="h-6 w-6 p-0"
|
|
248
|
+
onClick={handleCopy}
|
|
249
|
+
title={t("Copy to clipboard")}
|
|
250
|
+
>
|
|
251
|
+
{copied ? <Check className="h-3 w-3 text-green-500" /> : <Copy className="h-3 w-3" />}
|
|
252
|
+
</Button>
|
|
253
|
+
</div>
|
|
254
|
+
);
|
|
255
|
+
}
|