Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
feat: Add Axiom logging and enhance error tracking across application + update invoice form styles (#65)
Vlad Sazonaub4bbf3370a98
diff --git a/next.config.mjs b/next.config.mjsindex 38488b1..f921c87 100644--- a/next.config.mjs+++ b/next.config.mjs@@ -1,3 +1,5 @@+import { withAxiom } from "next-axiom";+/** @type {import('next').NextConfig} */const nextConfig = {typescript: {@@ -17,4 +19,4 @@ const nextConfig = {},};-export default nextConfig;+export default withAxiom(nextConfig);diff --git a/package.json b/package.jsonindex fecd82d..8d427ae 100644--- a/package.json+++ b/package.json@@ -19,6 +19,8 @@"@radix-ui/react-alert-dialog": "1.1.6","@radix-ui/react-dialog": "1.1.6","@radix-ui/react-label": "2.1.2",+ "@radix-ui/react-popover": "1.1.6",+ "@radix-ui/react-separator": "1.1.2","@radix-ui/react-slot": "1.1.2","@radix-ui/react-switch": "1.1.3","@radix-ui/react-tabs": "1.1.3",@@ -27,6 +29,7 @@"@react-pdf/renderer": "4.2.1","class-variance-authority": "0.7.1","clsx": "2.1.1",+ "cmdk": "1.0.0","dayjs": "1.11.13","file-saver": "2.0.5","jszip": "3.10.1",@@ -34,6 +37,7 @@"lz-string": "1.5.0","n2words": "1.21.0","next": "14.2.15",+ "next-axiom": "1.9.1","nuqs": "2.1.0","react": "18.3.1","react-dom": "18.3.1",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 072e371..cb79ffe 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -26,6 +26,12 @@ importers:'@radix-ui/react-label':specifier: 2.1.2version: 2.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-popover':+ specifier: 1.1.6+ version: 1.1.6(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-separator':+ specifier: 1.1.2+ version: 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-slot':specifier: 1.1.2version: 1.1.2(@types/[email protected])([email protected])@@ -50,6 +56,9 @@ importers:clsx:specifier: 2.1.1version: 2.1.1+ cmdk:+ specifier: 1.0.0+ version: 1.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])dayjs:specifier: 1.11.13version: 1.11.13@@ -71,6 +80,9 @@ importers:next:specifier: 14.2.15+ next-axiom:+ specifier: 1.9.1+ version: 1.9.1([email protected]([email protected]([email protected]))([email protected]))([email protected])nuqs:specifier: 2.1.0version: 2.1.0([email protected]([email protected]([email protected]))([email protected]))([email protected])@@ -309,6 +321,9 @@ packages:resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}engines: {node: '>=14'}+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}+'@radix-ui/[email protected]':resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==}@@ -377,6 +392,15 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==}peerDependencies:@@ -386,6 +410,15 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q==}peerDependencies:@@ -395,6 +428,19 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-/IVhJV5AceX620DUJ4uYVMymzsipdKBzo3edo+omeskCKGm9FRHM0ebIdbPnlQVJqyuHbuBltQUOG2mOTq2IYw==}peerDependencies:@@ -417,6 +463,19 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-E4TywXY6UsXNRhFrECa5HAvE5/4BFcGyfTyK36gP+pAW1ed7UTK4vKwdr53gAJYwqbfCWC6ATvJa3J3R/9+Qrg==}peerDependencies:@@ -430,6 +489,15 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==}peerDependencies:@@ -439,6 +507,19 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-zxwE80FCU7lcXUGWkdt6XpTTCKPitG1XKOwViTxHVKIJhZl9MvIl2dVHeZENCWD9+EdWv05wlaEkRXUykU27RA==}peerDependencies:@@ -452,6 +533,15 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==}peerDependencies:@@ -474,6 +564,19 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-NQouW0x4/GnkFJ/pRqsIS3rM/k97VzKnVb2jB7Gq7VEGPy5g7uNV1ykySFt7eWSp3i2uSGFwaJcvIRJBAHmmFg==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-Rvqc3nOpwseCyj/rgjlJDYAgyfw7OC1tTkKn2ivhaMGcYt8FSBlahHOZak2i3QwkRXUXgGgzeEe2RuqeEHuHgA==}peerDependencies:@@ -487,6 +590,19 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-sn2O9k1rPFYVyKd5LAJfo96JlSGVFpa1fS6UuBJfrZadudiw5tAmru+n1x7aMRQ84qDM71Zh1+SzK5QwU0tJfA==}peerDependencies:@@ -500,6 +616,19 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg==}peerDependencies:@@ -513,6 +642,19 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-Ec/0d38EIuvDF+GZjcMU/Ze6MxntVJYO/fRlCPhCaVUyPY9WTalHJw54tp9sXeJo3tlShWpy41vQRgLRGOuz+w==}peerDependencies:@@ -539,6 +681,28 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-oZfHcaAp2Y6KFBX6I5P1u7CQoy4lheCGiYj+pGFrHy8E/VNRb5E39TkTr3JrV520csPBTZjkuKFdEsjS5EUNKQ==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true++ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==}peerDependencies:@@ -587,6 +751,15 @@ packages:'@types/react-dom':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==}peerDependencies:@@ -596,6 +769,15 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==}peerDependencies:@@ -605,6 +787,15 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==}peerDependencies:@@ -614,6 +805,15 @@ packages:'@types/react':optional: true+ '@radix-ui/[email protected]':+ resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+'@radix-ui/[email protected]':resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==}peerDependencies:@@ -975,6 +1175,12 @@ packages:resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-gDzVf0a09TvoJ5jnuPvygTB77+XdOSwEmJ88L6XPFPlv7T3RxbP9jgenfylrAMD0+Le1aO0nVjQUzl2g+vjz5Q==}+ peerDependencies:+ react: ^18.0.0+ react-dom: ^18.0.0+resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}engines: {node: '>=7.0.0'}@@ -1060,6 +1266,10 @@ packages:resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==}@@ -1702,6 +1912,13 @@ packages:resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}+ resolution: {integrity: sha512-aSvfZHtGlcaSAGf+5IFTEgDIvqFaHkCUoFu9sNCy5bc8NxEl1v6cYhPZ54X0W9OQ9FyPRiHeD4DjxM/3p3yVRw==}+ engines: {node: '>=18'}+ peerDependencies:+ next: '>=14.0'+ react: '>=18.0.0'+resolution: {integrity: sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw==}engines: {node: '>=18.17.0'}@@ -2000,6 +2217,16 @@ packages:'@types/react':optional: true+ resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==}+ engines: {node: '>=10'}+ peerDependencies:+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0+ react: ^16.8.0 || ^17.0.0 || ^18.0.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+resolution: {integrity: sha512-pnAi91oOk8g8ABQKGF5/M9qxmmOPxaAnopyTHYfqYEwJhyFrbbBtHuSgtKEoH0jpcxx5o3hXqH1mNd9/Oi+8iQ==}engines: {node: '>=10'}@@ -2346,6 +2573,11 @@ packages:peerDependencies:react: '*'+ resolution: {integrity: sha512-94iG+dEdEP/Sl3WWde+w9StIunlV8Dgj+vkt5wTwMoFQLaijiEZSXXy8KtcStpmEDtIptRJiNeD4ACTtVvnIKA==}+ peerDependencies:+ react: '>=16.8.0'+resolution: {integrity: sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==}engines: {node: '>=10'}@@ -2363,6 +2595,9 @@ packages:resolution: {integrity: sha512-t20zYkrSf868+j/p31cRIGN28Phrjm3nRSLR2fyc2tiWi4cZGVdv68yNlwnIINTkMTmPoMiSlc0OadaO7DXZaQ==}engines: {node: '>= 6'}+ resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==}+resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}@@ -2566,6 +2801,10 @@ snapshots:'@pkgjs/[email protected]':optional: true+ '@radix-ui/[email protected]':+ dependencies:+ '@babel/runtime': 7.26.7+'@radix-ui/[email protected]': {}'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':@@ -2636,18 +2875,55 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ dependencies:+ '@babel/runtime': 7.26.7+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1optionalDependencies:'@types/react': 18.3.12+ dependencies:+ '@babel/runtime': 7.26.7+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1optionalDependencies:'@types/react': 18.3.12+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/primitive': 1.0.1+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.0.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-portal': 1.0.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])+ aria-hidden: 1.2.4+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ react-remove-scroll: 2.5.5(@types/[email protected])([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1@@ -2676,6 +2952,20 @@ snapshots:optionalDependencies:'@types/react': 18.3.12+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/primitive': 1.0.1+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-escape-keydown': 1.0.3(@types/[email protected])([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/primitive': 1.1.1@@ -2689,12 +2979,31 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ dependencies:+ '@babel/runtime': 7.26.7+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1optionalDependencies:'@types/react': 18.3.12+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])@@ -2706,6 +3015,14 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:'@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])@@ -2722,6 +3039,29 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@radix-ui/primitive': 1.1.1+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.1.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])+ '@radix-ui/react-focus-scope': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])+ '@radix-ui/react-popper': 1.2.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-portal': 1.1.4(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-presence': 1.1.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])+ aria-hidden: 1.2.4+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ react-remove-scroll: 2.6.3(@types/[email protected])([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:@@ -2740,6 +3080,16 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])@@ -2750,6 +3100,17 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])@@ -2760,6 +3121,16 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1+'@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:'@radix-ui/react-slot': 1.1.2(@types/[email protected])([email protected])@@ -2786,6 +3157,23 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ '@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ dependencies:+ '@radix-ui/react-primitive': 2.0.2(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+ '@types/react-dom': 18.3.1++ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:'@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])@@ -2844,12 +3232,27 @@ snapshots:'@types/react': 18.3.12'@types/react-dom': 18.3.1+ dependencies:+ '@babel/runtime': 7.26.7+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1optionalDependencies:'@types/react': 18.3.12+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])@@ -2857,6 +3260,14 @@ snapshots:optionalDependencies:'@types/react': 18.3.12+ dependencies:+ '@babel/runtime': 7.26.7+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])@@ -2864,6 +3275,13 @@ snapshots:optionalDependencies:'@types/react': 18.3.12+ dependencies:+ '@babel/runtime': 7.26.7+ react: 18.3.1+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1@@ -3318,6 +3736,16 @@ snapshots:+ [email protected](@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]):+ dependencies:+ '@radix-ui/react-dialog': 1.0.5(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ transitivePeerDependencies:+ - '@types/react'+ - '@types/react-dom'+dependencies:color-name: 1.1.4@@ -3412,6 +3840,8 @@ snapshots:has-property-descriptors: 1.0.2object-keys: 1.1.1+ [email protected]: {}+@@ -4209,6 +4639,13 @@ snapshots:+ [email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]):+ dependencies:+ react: 18.3.1+ use-deep-compare: 1.3.0([email protected])+ whatwg-fetch: 3.6.20+dependencies:'@next/env': 14.2.15@@ -4435,6 +4872,17 @@ snapshots:optionalDependencies:'@types/react': 18.3.12+ dependencies:+ react: 18.3.1+ react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])+ tslib: 2.8.1+ use-callback-ref: 1.3.3(@types/[email protected])([email protected])+ use-sidecar: 1.1.3(@types/[email protected])([email protected])+ optionalDependencies:+ '@types/react': 18.3.12+dependencies:react: 18.3.1@@ -4842,6 +5290,11 @@ snapshots:dependencies:react: 18.3.1+ dependencies:+ dequal: 2.0.3+ react: 18.3.1+dependencies:detect-node-es: 1.1.0@@ -4858,6 +5311,8 @@ snapshots:string_decoder: 1.3.0util-deprecate: 1.0.2+ [email protected]: {}+dependencies:is-bigint: 1.0.4diff --git a/src/app/components/invoice-form.tsx b/src/app/components/invoice-form.tsxindex 4f9772e..d936e0a 100644--- a/src/app/components/invoice-form.tsx+++ b/src/app/components/invoice-form.tsx@@ -35,6 +35,7 @@ import { zodResolver } from "@hookform/resolvers/zod";import { useOpenPanel } from "@openpanel/nextjs";import dayjs from "dayjs";import { AlertTriangle, Plus, Trash2 } from "lucide-react";+import { useLogger } from "next-axiom";import React, { useCallback, useEffect, useState } from "react";import { Controller, useFieldArray, useForm, useWatch } from "react-hook-form";import { toast } from "sonner";@@ -133,6 +134,7 @@ export function InvoiceForm({onInvoiceDataChange,}: InvoiceFormProps) {const openPanel = useOpenPanel();+ const log = useLogger();const {control,@@ -248,6 +250,12 @@ export function InvoiceForm({localStorage.setItem(PDF_DATA_LOCAL_STORAGE_KEY, stringifiedData);} catch (error) {console.error("Error saving to local storage:", error);++ log.error("error_saving_to_local_storage", {+ data: {+ error: error,+ },+ });}}},@@ -269,6 +277,7 @@ export function InvoiceForm({(index: number) => {remove(index);+ log.info("remove_invoice_item");// analytics track eventopenPanel.track("remove_invoice_item");umamiTrackEvent("remove_invoice_item");@@ -313,6 +322,12 @@ export function InvoiceForm({}} catch (error) {console.error("Error loading accordion state:", error);++ log.error("error_loading_accordion_state", {+ data: {+ error: error,+ },+ });}// Default to all sections open if no valid state found@@ -340,6 +355,12 @@ export function InvoiceForm({);} catch (error) {console.error("Error saving accordion state:", error);++ log.error("error_saving_accordion_state", {+ data: {+ error: error,+ },+ });}};@@ -1775,9 +1796,6 @@ export function InvoiceForm({<buttontype="button"onClick={() => {- // analytics track event- openPanel.track("add_invoice_item");-append({invoiceItemNumberIsVisible: true,name: "",@@ -1799,6 +1817,12 @@ export function InvoiceForm({typeOfGTU: "",typeOfGTUFieldIsVisible: true,});++ log.info("add_invoice_item");++ // analytics track event+ openPanel.track("add_invoice_item");+ umamiTrackEvent("add_invoice_item");}}className="mb-1 flex items-center text-sm font-medium text-gray-700 hover:text-black">diff --git a/src/app/components/invoice-pdf-download-link.tsx b/src/app/components/invoice-pdf-download-link.tsxindex afd29f0..152aab9 100644--- a/src/app/components/invoice-pdf-download-link.tsx+++ b/src/app/components/invoice-pdf-download-link.tsx@@ -10,6 +10,8 @@ import { LOADING_BUTTON_TEXT, LOADING_BUTTON_TIMEOUT } from "./invoice-form";import { toast } from "sonner";import { useOpenPanel } from "@openpanel/nextjs";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";+import { useLogger } from "next-axiom";export function InvoicePDFDownloadLink({invoiceData,@@ -21,6 +23,7 @@ export function InvoicePDFDownloadLink({}-${invoiceData.invoiceNumber.replace("/", "-")}.pdf`;const openPanel = useOpenPanel();+ const log = useLogger();const [{ loading: pdfLoading, url, error }, updatePdfInstance] = usePDF();@@ -46,34 +49,24 @@ export function InvoicePDFDownloadLink({useEffect(() => {if (error) {- toast.error(- <span>- Error generating document link. Please contact support{" "}- <a- href="mailto:[email protected]"- className="underline"- target="_blank"- rel="noopener noreferrer"- >- here- </a>{" "}- or fill a bug report{" "}- <a- href="https://pdfinvoicegenerator.userjot.com/board/bugs"- className="underline"- target="_blank"- rel="noopener noreferrer"- >- here- </a>- </span>,- {- duration: 10000,- }- );-- openPanel.track("error_generating_document_link");- umamiTrackEvent("error_generating_document_link");+ ErrorGeneratingPdfToast();++ log.error("error_generating_document_link", {+ data: {+ error: error,+ },+ });++ openPanel.track("error_generating_document_link", {+ data: {+ error: error,+ },+ });+ umamiTrackEvent("error_generating_document_link", {+ data: {+ error: error,+ },+ });}}, [error, openPanel]);@@ -84,6 +77,8 @@ export function InvoicePDFDownloadLink({download={filename}onClick={() => {if (!isLoading && url) {+ log.info("download_invoice");+openPanel.track("download_invoice");umamiTrackEvent("download_invoice");@@ -104,6 +99,8 @@ export function InvoicePDFDownloadLink({"noopener,noreferrer");+ log.info("donate_button_clicked_download_pdf_toast");+openPanel.track("donate_button_clicked_download_pdf_toast");umamiTrackEvent("donate_button_clicked_download_pdf_toast");},diff --git a/src/app/components/regenerate-invoice-button.tsx b/src/app/components/regenerate-invoice-button.tsxindex 6c9f693..a4d695a 100644--- a/src/app/components/regenerate-invoice-button.tsx+++ b/src/app/components/regenerate-invoice-button.tsx@@ -11,10 +11,11 @@ import { InvoicePdfTemplate } from "./invoice-pdf-template";import { usePDF } from "@react-pdf/renderer";import type { InvoiceData } from "../schema";import { useEffect, useState } from "react";-import { toast } from "sonner";import { Loader2 } from "lucide-react";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { useOpenPanel } from "@openpanel/nextjs";+import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";+import { useLogger } from "next-axiom";export function RegenerateInvoiceButton({invoiceData,@@ -26,6 +27,7 @@ export function RegenerateInvoiceButton({});const [isLoading, setIsLoading] = useState(false);const openPanel = useOpenPanel();+ const log = useLogger();useEffect(() => {if (pdfLoading) {@@ -41,7 +43,24 @@ export function RegenerateInvoiceButton({useEffect(() => {if (error) {- toast.error("Error generating document link");+ ErrorGeneratingPdfToast();++ log.error("error_generating_pdf_regenerate_button", {+ data: {+ error: error,+ },+ });++ openPanel.track("error_generating_pdf_regenerate_button", {+ data: {+ error: error,+ },+ });+ umamiTrackEvent("error_generating_pdf_regenerate_button", {+ data: {+ error: error,+ },+ });}}, [error]);@@ -55,6 +74,8 @@ export function RegenerateInvoiceButton({className="mt-2 w-full"disabled={isLoading}onClick={() => {+ log.info("regenerate_invoice");+// analytics eventsopenPanel.track("regenerate_invoice");umamiTrackEvent("regenerate_invoice");diff --git a/src/app/error.tsx b/src/app/error.tsxindex 90654e4..bbe4063 100644--- a/src/app/error.tsx+++ b/src/app/error.tsx@@ -8,6 +8,8 @@ import { PDF_DATA_LOCAL_STORAGE_KEY } from "./components/invoice-form";import { INITIAL_INVOICE_DATA } from "./constants";import { useOpenPanel } from "@openpanel/nextjs";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { LogLevel, useLogger } from "next-axiom";+import { usePathname } from "next/navigation";export default function Error({error,@@ -18,6 +20,27 @@ export default function Error({}) {const openPanel = useOpenPanel();+ const pathname = usePathname();+ const log = useLogger({ source: "error.tsx" });+ let status = error.message == "Invalid URL" ? 404 : 500;++ // https://github.com/axiomhq/next-axiom+ log.logHttpRequest(+ LogLevel.error,+ error.message,+ {+ host: window.location.href,+ path: pathname,+ statusCode: status,+ },+ {+ error: error.name,+ cause: error.cause,+ stack: error.stack,+ digest: error.digest,+ }+ );+useEffect(() => {// Log the error to an error reporting serviceconsole.error(error);@@ -54,6 +77,12 @@ export default function Error({() => {reset();+ log.error("error_button_try_again_clicked", {+ data: {+ error: error,+ },+ });+openPanel.track("error_button_try_again_clicked");umamiTrackEvent("error_button_try_again_clicked");}@@ -79,6 +108,12 @@ export default function Error({richColors: true,});+ log.info("error_button_start_from_scratch_clicked", {+ data: {+ error: error,+ },+ });+openPanel.track("error_button_start_from_scratch_clicked");umamiTrackEvent("error_button_start_from_scratch_clicked");} catch (error) {@@ -88,6 +123,12 @@ export default function Error({closeButton: true,richColors: true,});++ log.error("error_button_start_from_scratch_failed", {+ data: {+ error: error,+ },+ });}}}>diff --git a/src/app/layout.tsx b/src/app/layout.tsxindex a62fa70..4935abd 100644--- a/src/app/layout.tsx+++ b/src/app/layout.tsx@@ -2,6 +2,7 @@ import type { Metadata, Viewport } from "next";import { NuqsAdapter } from "nuqs/adapters/next/app";import { OpenPanelComponent } from "@openpanel/nextjs";import Script from "next/script";+import { AxiomWebVitals } from "next-axiom";import "./globals.css";import { Toaster } from "sonner";@@ -59,6 +60,12 @@ export default function RootLayout({<html lang="en"><body className={`antialiased`}><NuqsAdapter>{children}</NuqsAdapter>++ {/* https://sonner.emilkowal.ski/ */}+ <Toaster visibleToasts={1} richColors />++ <AxiomWebVitals />+{/* https://openpanel.dev/docs */}{process.env.NODE_ENV === "production" && (<OpenPanelComponent@@ -66,8 +73,7 @@ export default function RootLayout({trackScreenViews={true}/>)}- {/* https://sonner.emilkowal.ski/ */}- <Toaster visibleToasts={1} richColors />+{process.env.NODE_ENV === "production" && (<Script// we proxy umami check next.config.mjs rewritesdiff --git a/src/app/page.tsx b/src/app/page.tsxindex 859bc59..c24b6b8 100644--- a/src/app/page.tsx+++ b/src/app/page.tsx@@ -25,6 +25,7 @@ import { isLocalStorageAvailable } from "@/lib/check-local-storage";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";import { FileTextIcon, PencilIcon } from "lucide-react";+import { useLogger } from "next-axiom";const InvoicePDFViewer = dynamic(() =>@@ -55,6 +56,7 @@ export default function Home() {const searchParams = useSearchParams();const isDesktop = useMediaQuery("(min-width: 1024px)");const openPanel = useOpenPanel();+ const log = useLogger();const [invoiceDataState, setInvoiceDataState] = useState<InvoiceData | null>(null@@ -78,6 +80,12 @@ export default function Home() {// fallback to local storageconsole.error("Failed to parse URL data:", error);loadFromLocalStorage();++ log.error("failed_to_parse_url_data", {+ data: {+ error: error,+ },+ });}} else {// if no data in url, load from local storage@@ -102,6 +110,12 @@ export default function Home() {console.error("Failed to load saved invoice data:", error);setInvoiceDataState(INITIAL_INVOICE_DATA);++ log.error("failed_to_load_saved_invoice_data", {+ data: {+ error: error,+ },+ });}};@@ -155,11 +169,23 @@ export default function Home() {}} catch (error) {console.error("Failed to compare with URL data:", error);++ log.error("failed_to_compare_with_url_data", {+ data: {+ error: error,+ },+ });}}} catch (error) {console.error("Failed to save invoice data:", error);toast.error("Failed to save invoice data");++ log.error("failed_to_save_invoice_data", {+ data: {+ error: error,+ },+ });}}}, [invoiceDataState, router, searchParams]);@@ -186,12 +212,20 @@ export default function Home() {"Share this link to let others view and edit this invoice",});+ log.info("share_invoice_link");+// analytics track eventopenPanel.track("share_invoice_link");umamiTrackEvent("share_invoice_link");} catch (error) {console.error("Failed to share invoice:", error);toast.error("Failed to generate shareable link");++ log.error("share_invoice_link_failed", {+ data: {+ error: error,+ },+ });}}};@@ -286,7 +320,7 @@ export default function Home() {</div></TabsContent>{/* Action buttons visible in both tabs */}- <div className="sticky bottom-0 mt-4 flex flex-col gap-3 bg-white pb-2">+ <div className="sticky bottom-0 mt-4 flex flex-col gap-3 rounded-lg border border-t border-gray-200 bg-white px-3 pt-3 shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1),0_-2px_4px_-2px_rgba(0,0,0,0.05)]"><RegenerateInvoiceButton invoiceData={invoiceDataState} /><InvoicePDFDownloadLink invoiceData={invoiceDataState} /></div>@@ -301,7 +335,7 @@ export default function Home() {onInvoiceDataChange={handleInvoiceDataChange}/></div>- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-3 border-t border-gray-200 bg-white"><RegenerateInvoiceButton invoiceData={invoiceDataState} /></div></div>diff --git a/src/components/seller-dialog.tsx b/src/components/seller-dialog.tsxindex ca064fc..7f0133d 100644--- a/src/components/seller-dialog.tsx+++ b/src/components/seller-dialog.tsx@@ -30,6 +30,7 @@ import { toast } from "sonner";import { SELLERS_LOCAL_STORAGE_KEY } from "./seller-management";import { z } from "zod";import { useState } from "react";+import { useLogger } from "next-axiom";const SELLER_FORM_ID = "seller-form";interface SellerDialogProps {@@ -54,6 +55,8 @@ export function SellerDialog({initialData,isEditMode,}: SellerDialogProps) {+ const log = useLogger();+const form = useForm<SellerData>({resolver: zodResolver(sellerSchema),defaultValues: {@@ -150,6 +153,12 @@ export function SellerDialog({description: "Please try again",richColors: true,});++ log.error("error_saving_seller", {+ data: {+ error: error,+ },+ });}}diff --git a/src/components/seller-management.tsx b/src/components/seller-management.tsxindex 1dd0c15..147aa83 100644--- a/src/components/seller-management.tsx+++ b/src/components/seller-management.tsx@@ -30,6 +30,7 @@ import { Label } from "./ui/label";import { useOpenPanel } from "@openpanel/nextjs";import { isLocalStorageAvailable } from "@/lib/check-local-storage";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";+import { useLogger } from "next-axiom";export const SELLERS_LOCAL_STORAGE_KEY = "EASY_INVOICE_PDF_SELLERS";@@ -51,6 +52,7 @@ export function SellerManagement({const openPanel = useOpenPanel();const sellerSelectId = useId();+ const log = useLogger();const isEditMode = Boolean(editingSeller);@@ -79,6 +81,12 @@ export function SellerManagement({setSelectedSellerIndex(selectedSeller?.id ?? "");} catch (error) {console.error("Failed to load sellers:", error);++ log.error("error_loading_sellers", {+ data: {+ error: error,+ },+ });}}, [invoiceData.seller?.id]);@@ -117,6 +125,8 @@ export function SellerManagement({richColors: true,});+ log.info("add_seller_success");+// analytics track eventopenPanel.track("add_seller_success");umamiTrackEvent("add_seller_success");@@ -126,6 +136,12 @@ export function SellerManagement({toast.error("Failed to add seller", {closeButton: true,});++ log.error("add_seller_failed", {+ data: {+ error: error,+ },+ });}};@@ -151,6 +167,8 @@ export function SellerManagement({richColors: true,});+ log.info("edit_seller_success");+// analytics track eventopenPanel.track("edit_seller_success");umamiTrackEvent("edit_seller_success");@@ -160,6 +178,12 @@ export function SellerManagement({toast.error("Failed to edit seller", {closeButton: true,});++ log.error("edit_seller_failed", {+ data: {+ error: error,+ },+ });}};@@ -181,6 +205,8 @@ export function SellerManagement({setValue("seller", DEFAULT_SELLER_DATA);}+ log.info("change_seller");+// analytics track eventopenPanel.track("change_seller");umamiTrackEvent("change_seller");@@ -211,6 +237,8 @@ export function SellerManagement({richColors: true,});+ log.info("delete_seller_success");+// analytics track eventopenPanel.track("delete_seller_success");umamiTrackEvent("delete_seller_success");@@ -220,6 +248,12 @@ export function SellerManagement({toast.error("Failed to delete seller", {closeButton: true,});++ log.error("delete_seller_failed", {+ data: {+ error: error,+ },+ });}};diff --git a/src/components/ui/toasts/error-generating-pdf-toast.tsx b/src/components/ui/toasts/error-generating-pdf-toast.tsxnew file mode 100644index 0000000..19cc635--- /dev/null+++ b/src/components/ui/toasts/error-generating-pdf-toast.tsx@@ -0,0 +1,30 @@+import { toast } from "sonner";++export function ErrorGeneratingPdfToast() {+ return toast.error(+ <span>+ Error generating document link. Please try to reload the page or contact+ support{" "}+ <a+ href="mailto:[email protected]"+ className="underline"+ target="_blank"+ rel="noopener noreferrer"+ >+ here+ </a>{" "}+ or fill a bug report{" "}+ <a+ href="https://pdfinvoicegenerator.userjot.com/board/bugs"+ className="underline"+ target="_blank"+ rel="noopener noreferrer"+ >+ here+ </a>+ </span>,+ {+ duration: 10000,+ }+ );+}diff --git a/src/lib/umami-analytics-track-event.tsx b/src/lib/umami-analytics-track-event.tsxindex fbe50d0..842d89f 100644--- a/src/lib/umami-analytics-track-event.tsx+++ b/src/lib/umami-analytics-track-event.tsx@@ -46,5 +46,13 @@ export const umamiTrackEvent = (window.umami?.track(eventName, options);} catch (error) {console.error("Failed to track event:", error);++ if (error instanceof Error) {+ umamiTrackEvent("error_tracking_umami_event", {+ data: {+ error: error.message,+ },+ });+ }}};diff --git a/src/lib/utils.ts b/src/lib/utils.tsindex c46f600..9d4fb1d 100644--- a/src/lib/utils.ts+++ b/src/lib/utils.ts@@ -4,6 +4,7 @@ import n2words from "n2words";import { toast } from "sonner";import { SUPPORTED_LANGUAGES, type SupportedLanguages } from "@/app/schema";import { z } from "zod";+import { umamiTrackEvent } from "./umami-analytics-track-event";export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));@@ -47,6 +48,14 @@ export function getAmountInWords({console.error("Failed to convert number to words:", error);toast.error("Failed to convert number to words");+ if (error instanceof Error) {+ umamiTrackEvent("error_converting_number_to_words", {+ data: {+ error: error?.message ?? "Unknown error",+ },+ });+ }+amountInWords = Math.floor(amount ?? 0).toString();}