diff --git a/package.json b/package.json index fc0ca27..8ca4951 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "lucide-react": "^0.304.0", "next": "^14.1.0", "next-intl": "^3.9.1", + "nuqs": "^1.17.1", "query-string": "^8.1.0", "react": "^18", "react-dom": "^18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d05843..4651303 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,6 +71,9 @@ dependencies: next-intl: specifier: ^3.9.1 version: 3.9.1(next@14.1.0)(react@18.2.0) + nuqs: + specifier: ^1.17.1 + version: 1.17.1(next@14.1.0) query-string: specifier: ^8.1.0 version: 8.1.0 @@ -725,7 +728,6 @@ packages: /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.23.7): resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -3196,7 +3198,7 @@ packages: dev: true /@octokit/auth-token@2.5.0: - resolution: {integrity: sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==} + resolution: {integrity: sha1-J8N+omwgXyhENAJHf/0mExHyHjY=} dependencies: '@octokit/types': 6.41.0 dev: true @@ -3254,7 +3256,7 @@ packages: dev: true /@octokit/endpoint@6.0.12: - resolution: {integrity: sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==} + resolution: {integrity: sha1-O01HpLDnmxAn+4111CIZKLLQVlg=} dependencies: '@octokit/types': 6.41.0 is-plain-object: 5.0.0 @@ -3279,7 +3281,7 @@ packages: dev: true /@octokit/graphql@4.8.0: - resolution: {integrity: sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==} + resolution: {integrity: sha1-Zk2bEcDhIRLL944Q9JoFlZqiLMM=} dependencies: '@octokit/request': 5.6.3 '@octokit/types': 6.41.0 @@ -3342,7 +3344,7 @@ packages: dev: true /@octokit/plugin-request-log@1.0.4(@octokit/core@4.2.4): - resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==} + resolution: {integrity: sha1-XlDtcIOmE4FrHkooruxft/FGLoU=} peerDependencies: '@octokit/core': '>=3' dependencies: @@ -3400,7 +3402,7 @@ packages: dev: true /@octokit/request-error@2.1.0: - resolution: {integrity: sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==} + resolution: {integrity: sha1-nhUDV4Mb/HiNE6T9SxkT1gx01nc=} dependencies: '@octokit/types': 6.41.0 deprecation: 2.3.1 @@ -4195,7 +4197,7 @@ packages: dev: true /@semantic-release/error@3.0.0: - resolution: {integrity: sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==} + resolution: {integrity: sha1-MKO5e7tYRNaV6yL506pA9qkncMI=} engines: {node: '>=14.17'} dev: true @@ -4544,6 +4546,7 @@ packages: engines: {node: '>=10'} cpu: [arm64] os: [linux] + libc: [glibc] requiresBuild: true optional: true @@ -4552,6 +4555,7 @@ packages: engines: {node: '>=10'} cpu: [arm64] os: [linux] + libc: [musl] requiresBuild: true optional: true @@ -4560,6 +4564,7 @@ packages: engines: {node: '>=10'} cpu: [x64] os: [linux] + libc: [glibc] requiresBuild: true optional: true @@ -4568,6 +4573,7 @@ packages: engines: {node: '>=10'} cpu: [x64] os: [linux] + libc: [musl] requiresBuild: true optional: true @@ -4732,7 +4738,7 @@ packages: dev: false /@tootallnate/once@2.0.0: - resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + resolution: {integrity: sha1-9UShSNOrNYAcH2M6dEH9h8LkhL8=} engines: {node: '>= 10'} dev: true @@ -5664,7 +5670,7 @@ packages: dev: true /agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + resolution: {integrity: sha1-Sf/1hXfP7j83F2/qtMIuAPhtf3c=} engines: {node: '>= 6.0.0'} dependencies: debug: 4.3.4 @@ -5682,7 +5688,7 @@ packages: dev: true /aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + resolution: {integrity: sha1-kmcP9Q9TWb23o+DUDQ7DDFc3aHo=} engines: {node: '>=8'} dependencies: clean-stack: 2.2.0 @@ -5758,7 +5764,7 @@ packages: dev: true /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + resolution: {integrity: sha1-ayKR0dt9mLZSHV8e+kLQ86n+tl4=} engines: {node: '>=8'} dependencies: type-fest: 0.21.3 @@ -5799,7 +5805,7 @@ packages: dev: true /ansicolors@0.3.2: - resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} + resolution: {integrity: sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=} dev: true /antd-mobile-icons@0.3.0: @@ -5931,7 +5937,7 @@ packages: resolution: {integrity: sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=} /argv-formatter@1.0.0: - resolution: {integrity: sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==} + resolution: {integrity: sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=} dev: true /aria-query@5.3.0: @@ -6261,7 +6267,7 @@ packages: dev: false /bottleneck@2.19.5: - resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} + resolution: {integrity: sha1-XfC5D1n9R2VuvmPHiphBkgXK3ZE=} dev: true /brace-expansion@1.1.11: @@ -6305,7 +6311,7 @@ packages: dev: false /buffer-crc32@0.2.13: - resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} + resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=} dev: false /buffer-from@0.1.2: @@ -6381,7 +6387,7 @@ packages: dev: false /cardinal@2.1.1: - resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} + resolution: {integrity: sha1-fMEFXYItISlU0HsIXeolHMe8VQU=} hasBin: true dependencies: ansicolors: 0.3.2 @@ -6400,7 +6406,7 @@ packages: supports-color: 5.5.0 /chalk@3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} + resolution: {integrity: sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=} engines: {node: '>=8'} dependencies: ansi-styles: 4.3.0 @@ -6421,7 +6427,7 @@ packages: dev: true /char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + resolution: {integrity: sha1-10Q1giYhf5ge1Y9Hmx1rzClUXc8=} engines: {node: '>=10'} dev: true @@ -6473,7 +6479,7 @@ packages: dev: true /clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + resolution: {integrity: sha1-7oRy27Ep5yezHooQpCfe6d/kAIs=} engines: {node: '>=6'} dev: true @@ -6531,7 +6537,7 @@ packages: dev: true /clone-deep@4.0.1: - resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + resolution: {integrity: sha1-wZ/Zvbv4WUK0/ZechNz31fB8I4c=} engines: {node: '>=6'} dependencies: is-plain-object: 2.0.4 @@ -6638,7 +6644,7 @@ packages: dev: true /commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + resolution: {integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=} dev: false /compare-func@2.0.0: @@ -6667,7 +6673,7 @@ packages: dev: true /config-chain@1.1.13: - resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + resolution: {integrity: sha1-+tB5Wqamza/57Rto6d/5Q3LCMvQ=} dependencies: ini: 1.3.8 proto-list: 1.2.4 @@ -6857,7 +6863,7 @@ packages: dev: true /crypto-random-string@4.0.0: - resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==} + resolution: {integrity: sha1-WjzFPX3YYYPfXaAxKBbO7rW7H8I=} engines: {node: '>=12'} dependencies: type-fest: 1.4.0 @@ -6992,7 +6998,7 @@ packages: engines: {node: '>=14.16'} /deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + resolution: {integrity: sha1-xPp8lUBKF6nD6Mp+FTcxK3NjMKw=} engines: {node: '>=4.0.0'} dev: true @@ -7045,7 +7051,7 @@ packages: dev: false /deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} + resolution: {integrity: sha1-Y2jL20Cr8zc7UlrIfkomDDpwCRk=} dev: true /dequal@2.0.3: @@ -7817,7 +7823,7 @@ packages: dev: true /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + resolution: {integrity: sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=} engines: {node: '>=4'} hasBin: true dev: true @@ -8022,13 +8028,13 @@ packages: dev: true /fd-slicer@1.1.0: - resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + resolution: {integrity: sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=} dependencies: pend: 1.2.0 dev: false /figures@2.0.0: - resolution: {integrity: sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==} + resolution: {integrity: sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=} engines: {node: '>=4'} dependencies: escape-string-regexp: 1.0.5 @@ -8094,7 +8100,7 @@ packages: dev: false /find-cache-dir@2.1.0: - resolution: {integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==} + resolution: {integrity: sha1-jQ+UzRP+Q8bHwmGg2GEVypGMBfc=} engines: {node: '>=6'} dependencies: commondir: 1.0.1 @@ -8112,14 +8118,14 @@ packages: dev: true /find-up@2.1.0: - resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} + resolution: {integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c=} engines: {node: '>=4'} dependencies: locate-path: 2.0.0 dev: true /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + resolution: {integrity: sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=} engines: {node: '>=6'} dependencies: locate-path: 3.0.0 @@ -8238,7 +8244,7 @@ packages: dev: false /from2@2.3.0: - resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==} + resolution: {integrity: sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=} dependencies: inherits: 2.0.4 readable-stream: 2.3.8 @@ -8254,7 +8260,7 @@ packages: dev: true /fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + resolution: {integrity: sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=} engines: {node: '>=6 <7 || >=8'} dependencies: graceful-fs: 4.2.11 @@ -8383,7 +8389,7 @@ packages: dev: true /git-log-parser@1.2.0: - resolution: {integrity: sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==} + resolution: {integrity: sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo=} dependencies: argv-formatter: 1.0.0 spawn-error-forwarder: 1.0.0 @@ -8752,7 +8758,7 @@ packages: dev: false /hook-std@3.0.0: - resolution: {integrity: sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==} + resolution: {integrity: sha1-RwOKAZgeB86dg6ajsuuYytD3vVg=} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true @@ -8819,7 +8825,7 @@ packages: dev: false /http-proxy-agent@5.0.0: - resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + resolution: {integrity: sha1-USmAAgNSDUNPFCvHj/PBcIAPK0M=} engines: {node: '>= 6'} dependencies: '@tootallnate/once': 2.0.0 @@ -9031,7 +9037,7 @@ packages: dev: false /into-stream@7.0.0: - resolution: {integrity: sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==} + resolution: {integrity: sha1-0aIR4Ua+is/bhNq8vwD+ggXnKTY=} engines: {node: '>=12'} dependencies: from2: 2.3.0 @@ -9356,7 +9362,7 @@ packages: dev: false /issue-parser@6.0.0: - resolution: {integrity: sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==} + resolution: {integrity: sha1-se3QYxXU8gRKl1Xa+F/a/em0AUo=} engines: {node: '>=10.13'} dependencies: lodash.capitalize: 4.2.1 @@ -9397,7 +9403,7 @@ packages: dev: true /java-properties@1.0.2: - resolution: {integrity: sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==} + resolution: {integrity: sha1-zNH6c5B0OKW1w4mCJp0Odx/nghE=} engines: {node: '>= 0.6.0'} dev: true @@ -9461,7 +9467,7 @@ packages: dev: true /json-parse-better-errors@1.0.2: - resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + resolution: {integrity: sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=} dev: true /json-parse-even-better-errors@2.3.1: @@ -9489,7 +9495,7 @@ packages: dev: true /json-stringify-safe@5.0.1: - resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + resolution: {integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=} dev: true /json2mq@0.2.0: @@ -9511,7 +9517,7 @@ packages: hasBin: true /jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + resolution: {integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=} optionalDependencies: graceful-fs: 4.2.11 dev: false @@ -9691,7 +9697,7 @@ packages: dev: false /load-json-file@4.0.0: - resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} + resolution: {integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs=} engines: {node: '>=4'} dependencies: graceful-fs: 4.2.11 @@ -9713,7 +9719,7 @@ packages: dev: true /locate-path@2.0.0: - resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} + resolution: {integrity: sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=} engines: {node: '>=4'} dependencies: p-locate: 2.0.0 @@ -9721,7 +9727,7 @@ packages: dev: true /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + resolution: {integrity: sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=} engines: {node: '>=6'} dependencies: p-locate: 3.0.0 @@ -9757,7 +9763,7 @@ packages: dev: true /lodash.capitalize@4.2.1: - resolution: {integrity: sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==} + resolution: {integrity: sha1-+CbJtOKoUR2E46yinbBeGk87cqk=} dev: true /lodash.clonedeep@4.5.0: @@ -9767,7 +9773,7 @@ packages: resolution: {integrity: sha1-gteb/zCmfEAF/9XiUVMArZyk168=} /lodash.escaperegexp@4.1.2: - resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} + resolution: {integrity: sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=} dev: true /lodash.get@4.4.2: @@ -9783,7 +9789,7 @@ packages: dev: true /lodash.isstring@4.0.1: - resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + resolution: {integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=} dev: true /lodash.kebabcase@4.1.1: @@ -9893,7 +9899,7 @@ packages: dev: true /make-dir@2.1.0: - resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} + resolution: {integrity: sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=} engines: {node: '>=6'} dependencies: pify: 4.0.1 @@ -10692,7 +10698,7 @@ packages: dev: false /mime@3.0.0: - resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} + resolution: {integrity: sha1-s3RVDco6DBhEOwyVCmpY8ZMc96c=} engines: {node: '>=10.0.0'} hasBin: true dev: true @@ -10759,6 +10765,10 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dev: true + /mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + dev: false + /mixin-deep@1.3.2: resolution: {integrity: sha1-ESC0PcNZp4Xc5ltVuC4lfM9HlWY=} engines: {node: '>=0.10.0'} @@ -10820,7 +10830,7 @@ packages: dev: true /nerf-dart@1.0.0: - resolution: {integrity: sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==} + resolution: {integrity: sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo=} dev: true /next-intl@3.9.1(next@14.1.0)(react@18.2.0): @@ -11063,6 +11073,15 @@ packages: boolbase: 1.0.0 dev: false + /nuqs@1.17.1(next@14.1.0): + resolution: {integrity: sha512-zJPisj8L+SzKzt57c5s3fJW0ikksPr+PyeLyNwvx0i5ggTr5XR5uFhCoX/T+Mkmb6X5UxHB/0nnuZyFiQsh0cA==} + peerDependencies: + next: '>=13.4 <14.0.2 || ^14.0.3' + dependencies: + mitt: 3.0.1 + next: 14.1.0(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0) + dev: false + /object-assign@4.1.1: resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=} engines: {node: '>=0.10.0'} @@ -11190,12 +11209,12 @@ packages: dev: true /p-each-series@3.0.0: - resolution: {integrity: sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==} + resolution: {integrity: sha1-0a7V6W7ymGTIlzZ6fSpij9yWCAY=} engines: {node: '>=12'} dev: true /p-filter@2.1.0: - resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + resolution: {integrity: sha1-GxRyVirnoPdC8PPT03GOpm/5wJw=} engines: {node: '>=8'} dependencies: p-map: 2.1.0 @@ -11209,12 +11228,12 @@ packages: dev: true /p-is-promise@3.0.0: - resolution: {integrity: sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==} + resolution: {integrity: sha1-WOeMff4uFjzyoE/4aefB26ZKWXE=} engines: {node: '>=8'} dev: true /p-limit@1.3.0: - resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} + resolution: {integrity: sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=} engines: {node: '>=4'} dependencies: p-try: 1.0.0 @@ -11241,14 +11260,14 @@ packages: dev: true /p-locate@2.0.0: - resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} + resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=} engines: {node: '>=4'} dependencies: p-limit: 1.3.0 dev: true /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + resolution: {integrity: sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=} engines: {node: '>=6'} dependencies: p-limit: 2.3.0 @@ -11291,12 +11310,12 @@ packages: dev: true /p-reduce@3.0.0: - resolution: {integrity: sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==} + resolution: {integrity: sha1-8RdzeUeSl0vR96FMcpNCSKv/QWA=} engines: {node: '>=12'} dev: true /p-try@1.0.0: - resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} + resolution: {integrity: sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=} engines: {node: '>=4'} dev: true @@ -11316,7 +11335,7 @@ packages: callsites: 3.1.0 /parse-json@4.0.0: - resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} + resolution: {integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=} engines: {node: '>=4'} dependencies: error-ex: 1.3.2 @@ -11368,7 +11387,7 @@ packages: dev: true /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + resolution: {integrity: sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=} engines: {node: '>=4'} /path-exists@4.0.0: @@ -11419,12 +11438,12 @@ packages: engines: {node: '>=8'} /path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} + resolution: {integrity: sha1-FLAe166n3fnHw/RhgdTQT5x4W7g=} engines: {node: '>=12'} dev: true /pend@1.2.0: - resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + resolution: {integrity: sha1-elfrVQpng/kRUzH89GY9XI4AelA=} dev: false /picocolors@1.0.0: @@ -11446,7 +11465,7 @@ packages: dev: true /pify@3.0.0: - resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} + resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=} engines: {node: '>=4'} dev: true @@ -11500,7 +11519,7 @@ packages: dev: false /pkg-conf@2.1.0: - resolution: {integrity: sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==} + resolution: {integrity: sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=} engines: {node: '>=4'} dependencies: find-up: 2.1.0 @@ -11508,7 +11527,7 @@ packages: dev: true /pkg-dir@3.0.0: - resolution: {integrity: sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==} + resolution: {integrity: sha1-J0kCDyOe2ZCIGx9xIQ1R62UjvqM=} engines: {node: '>=6'} dependencies: find-up: 3.0.0 @@ -11723,7 +11742,7 @@ packages: dev: false /proto-list@1.2.4: - resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + resolution: {integrity: sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=} dev: true /proxy-addr@2.0.7: @@ -12342,7 +12361,7 @@ packages: dev: false /rc@1.2.8: - resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + resolution: {integrity: sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0=} hasBin: true dependencies: deep-extend: 0.6.0 @@ -12656,7 +12675,7 @@ packages: dev: true /redeyed@2.1.1: - resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} + resolution: {integrity: sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=} dependencies: esprima: 4.0.1 dev: true @@ -13948,7 +13967,7 @@ packages: dev: false /semver-diff@4.0.0: - resolution: {integrity: sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==} + resolution: {integrity: sha1-Ovz17W1iJZ9cctDV1Q3/vcloDfU=} engines: {node: '>=12'} dependencies: semver: 7.5.4 @@ -14059,7 +14078,7 @@ packages: dev: true /shallow-clone@3.0.1: - resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + resolution: {integrity: sha1-jymBrZJTH1UDWwH7IwdppA4C76M=} engines: {node: '>=8'} dependencies: kind-of: 6.0.3 @@ -14132,7 +14151,7 @@ packages: dev: true /signale@1.4.0: - resolution: {integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==} + resolution: {integrity: sha1-xL5YMC+wJirAD8PYhqfBE3WQQvE=} engines: {node: '>=6'} dependencies: chalk: 2.4.2 @@ -14279,7 +14298,7 @@ packages: dev: false /spawn-error-forwarder@1.0.0: - resolution: {integrity: sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==} + resolution: {integrity: sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk=} dev: true /spdx-correct@3.2.0: @@ -14342,7 +14361,7 @@ packages: dev: false /split2@1.0.0: - resolution: {integrity: sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==} + resolution: {integrity: sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ=} dependencies: through2: 2.0.5 dev: true @@ -14372,7 +14391,7 @@ packages: dev: false /stream-combiner2@1.1.1: - resolution: {integrity: sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==} + resolution: {integrity: sha1-+02KFCDqNidk4hrUeAOXvry0HL4=} dependencies: duplexer2: 0.1.4 readable-stream: 2.3.8 @@ -14543,7 +14562,7 @@ packages: dev: true /strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=} engines: {node: '>=0.10.0'} dev: true @@ -14901,7 +14920,7 @@ packages: dev: false /through2@2.0.5: - resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} + resolution: {integrity: sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=} dependencies: readable-stream: 2.3.8 xtend: 4.0.2 @@ -15053,7 +15072,7 @@ packages: dev: true /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + resolution: {integrity: sha1-0mCiSwGYQ24TP6JqUkptZfo7Ljc=} engines: {node: '>=10'} dev: false @@ -15302,7 +15321,7 @@ packages: dev: true /unique-string@3.0.0: - resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} + resolution: {integrity: sha1-hKHDd6/1/XqLxrVdgkSyvZDXW5o=} engines: {node: '>=12'} dependencies: crypto-random-string: 4.0.0 @@ -15441,7 +15460,7 @@ packages: dev: true /universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + resolution: {integrity: sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=} engines: {node: '>= 4.0.0'} dev: false @@ -15488,7 +15507,7 @@ packages: dev: true /url-join@4.0.1: - resolution: {integrity: sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==} + resolution: {integrity: sha1-tkLiGiZGgI/6F4xMX9o5hE4Szec=} dev: true /url-join@5.0.0: @@ -15807,7 +15826,7 @@ packages: isexe: 2.0.0 /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + resolution: {integrity: sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=} dev: true /workbox-background-sync@7.0.0: @@ -16054,7 +16073,7 @@ packages: dev: false /xtend@4.0.2: - resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + resolution: {integrity: sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=} engines: {node: '>=0.4'} dev: true @@ -16107,7 +16126,7 @@ packages: dev: true /yauzl@2.10.0: - resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} + resolution: {integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=} dependencies: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 diff --git a/public/404/404.jpg b/public/404/404.jpg new file mode 100644 index 0000000..eaed832 Binary files /dev/null and b/public/404/404.jpg differ diff --git a/public/404/404.png b/public/404/404.png deleted file mode 100644 index b827423..0000000 Binary files a/public/404/404.png and /dev/null differ diff --git a/public/404/4xx.jpg b/public/404/4xx.jpg new file mode 100644 index 0000000..96030d6 Binary files /dev/null and b/public/404/4xx.jpg differ diff --git a/server.mjs b/server.mjs index 7a0c466..1ec9811 100644 --- a/server.mjs +++ b/server.mjs @@ -20,7 +20,6 @@ async function bootstrap() { if (!oidcServerUrl) { console.warn('The env OIDC_SERVER_URL must be configured!') process.exit(); - return; } const oidcUrlObj = url.parse(oidcServerUrl); const _url = `${oidcUrlObj.protocol}//${oidcUrlObj.host}`; diff --git a/src/app/[locale]/agent/components/TagContent/index.tsx b/src/app/[locale]/agent/components/TagContent/index.tsx index 60acf19..c6dee0f 100644 --- a/src/app/[locale]/agent/components/TagContent/index.tsx +++ b/src/app/[locale]/agent/components/TagContent/index.tsx @@ -1,10 +1,11 @@ 'use client'; import { LeftOutlined, RightOutlined } from '@ant-design/icons'; -import { Radio } from 'antd'; +import { Radio, RadioChangeEvent } from 'antd'; import classNames from 'classnames'; import { useTranslations } from 'next-intl'; import { useParams } from 'next/navigation'; +import { useQueryState } from 'nuqs'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useStyles } from './styles'; @@ -17,9 +18,10 @@ interface TagContentProps { // 首先这里不能 memo, 用户存在使用过程中拖拽窗口大小 const TagContent = ({ handleSelectTagChange, selectedTag, cateList = [] }: TagContentProps) => { const t = useTranslations(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const [_, setQueryCategory] = useQueryState('category'); const { styles } = useStyles(); const scrollLeftRef = useRef(0); - const currentBtnRef = useRef(null); const [leftArrowVisible, setLeftArrowVisible] = useState(false); const [rightArrowVisible, setRightArrowVisible] = useState(false); const [windowWidth, setWindowWidth] = useState(0); @@ -28,33 +30,56 @@ const TagContent = ({ handleSelectTagChange, selectedTag, cateList = [] }: TagCo const handleScroll = useCallback((direction: string) => { const scrollAmount = window.innerWidth - 39; // You can adjust the scroll amount as needed const buttonList = document?.querySelector('#btns'); + let left: number = 0; if (direction === 'left') { - buttonList!.scrollLeft -= scrollAmount; + left = buttonList!.scrollLeft - scrollAmount; } else if (direction === 'right') { - buttonList!.scrollLeft += scrollAmount; + left = buttonList!.scrollLeft + scrollAmount; } + buttonList?.scrollTo({ + left, + behavior: 'smooth', + }); }, []); - const onChange = (tag: any) => { - const value = tag?.target?.value; - handleSelectTagChange(value); - currentBtnRef.current = tag; - // 获取事件源(按钮元素) - const button = document?.querySelector(`[id='${tag?.target?.value}']`); - const scrollContainer = document?.querySelector('#btns'); + const onChange = useCallback( + (e?: RadioChangeEvent) => { + const value = e?.target?.value; + if (e) { + handleSelectTagChange(value); + } + // 获取事件源(按钮元素) + const button: HTMLElement | null = document.querySelector( + `[id='category_${value || selectedTag || ''}']` + ); + const scrollContainer: HTMLElement | null = document.querySelector('#btns'); - if (button && scrollContainer) { - // 获取按钮的位置信息 - const rect = button.getBoundingClientRect(); - const targetLeft = - rect.left + scrollContainer?.scrollLeft - (scrollContainer!.offsetWidth - rect.width) / 2; - // 滚动到目标位置 - scrollContainer.scrollTo({ - left: targetLeft, - behavior: 'smooth', - }); - } - }; + if (button && scrollContainer) { + // 获取按钮的位置信息 + const rect = button.getBoundingClientRect(); + const containerRect = scrollContainer.getBoundingClientRect(); + // 计算按钮中心点相对于滚动容器左侧的距离 + const buttonCenter = + rect.left - + containerRect.left + + scrollContainer.scrollLeft + + (button.offsetParent as HTMLElement)?.offsetWidth / 2; + // 计算为了让按钮居中,容器应该滚动的目标位置 + const targetScrollLeft = buttonCenter - scrollContainer.offsetWidth / 2; + // 确保目标滚动位置在有效范围内 + const safeTargetScrollLeft = Math.min( + Math.max(targetScrollLeft, 0), + scrollContainer.scrollWidth - scrollContainer.offsetWidth + ); + // 执行滚动操作 + scrollContainer.scrollTo({ + left: safeTargetScrollLeft, + behavior: 'smooth', + }); + } + }, + [handleSelectTagChange, selectedTag] + ); useEffect(() => { // 获取包含内容的元素,例如 body 或任何带有横向滚动的容器 const scrollContainer = document?.querySelector('#btns'); @@ -72,7 +97,7 @@ const TagContent = ({ handleSelectTagChange, selectedTag, cateList = [] }: TagCo setRightArrowVisible(false); } else { setRightArrowVisible(true); - onChange(currentBtnRef.current); + onChange(); } } else { setLeftArrowVisible(false); @@ -99,20 +124,26 @@ const TagContent = ({ handleSelectTagChange, selectedTag, cateList = [] }: TagCo window.removeEventListener('resize', resize); scrollContainer?.removeEventListener('scroll', scroll); }; - }, []); + }, [scrollLeftRef]); return (
{leftArrowVisible &&
} {leftArrowVisible && ( -
- handleScroll('left')} /> +
handleScroll('left')} + > +
)} {rightArrowVisible &&
} {rightArrowVisible && ( -
- handleScroll('right')} /> +
handleScroll('right')} + > +
)}
@@ -120,14 +151,23 @@ const TagContent = ({ handleSelectTagChange, selectedTag, cateList = [] }: TagCo buttonStyle="solid" className={windowWidth >= 879 ? styles.btnListHidden : styles.btnListOverflow} id="btns" - onChange={onChange} + onChange={(e: RadioChangeEvent) => { + const value = e.target.value; + setQueryCategory(value || null); + onChange(e); + }} value={selectedTag} > {[ { id: '', name: t('components.index.tuiJian'), nameEn: t('components.index.tuiJian') }, ...cateList, ]?.map(item => ( - + {item[locale === 'zh' ? 'name' : 'nameEn']} ))} diff --git a/src/app/[locale]/agent/components/TagContent/styles.ts b/src/app/[locale]/agent/components/TagContent/styles.ts index 822a1c5..4b031a5 100644 --- a/src/app/[locale]/agent/components/TagContent/styles.ts +++ b/src/app/[locale]/agent/components/TagContent/styles.ts @@ -2,8 +2,19 @@ import { createStyles } from 'antd-style'; export const useStyles = createStyles(({ token }) => ({ tagContent: { - margin: `0 0 20px 0`, - width: `100%`, + 'margin': `0 0 20px 0`, + 'width': `100%`, + '@media (max-width: 879px)': { + '& .ant-radio-group': { + display: 'flex !important', + flexWrap: 'nowrap !important' as 'nowrap', + }, + }, + '& .ant-radio-group': { + display: 'inline-flex', + gap: '8px', + flexWrap: 'wrap', + }, }, btnListOverflow: { display: 'flex', @@ -56,10 +67,8 @@ export const useStyles = createStyles(({ token }) => ({ }, btn: { 'whiteSpace': 'nowrap', - 'marginBottom': 8, '&.ant-radio-button-wrapper': { borderInlineStart: `1px solid ${token.colorBorder}`, - marginRight: 10, borderRadius: '12px', }, '&.ant-radio-button-wrapper:not(:first-child)::before': { diff --git a/src/app/[locale]/agent/components/index.tsx b/src/app/[locale]/agent/components/index.tsx index 973ec05..9bd1f14 100644 --- a/src/app/[locale]/agent/components/index.tsx +++ b/src/app/[locale]/agent/components/index.tsx @@ -7,8 +7,8 @@ import classNames from 'classnames'; import { useTranslations } from 'next-intl'; import Image from 'next/image'; import { useRouter } from 'next/navigation'; -// import { useRouter } from 'next/navigation'; -import React, { useEffect, useState } from 'react'; +import { useQueryState } from 'nuqs'; +import React, { useState } from 'react'; import TitleCom from '@/components/Title'; import { useAuthContext } from '@/layout/AuthLayout'; @@ -46,9 +46,10 @@ const Agent = React.memo(({ agentData, cateData }) => { const t = useTranslations(); const { authed } = useAuthContext(); const router = useRouter(); + const [category] = useQueryState('category'); const { styles } = useStyles(); // "",表示推荐标签" - const [selectedTag, setSelectedTags] = useState(''); + const [selectedTag, setSelectedTags] = useState(category || ''); // const [pageSize, setPageSize] = useState(-1); // const [page, setPage] = useState(1); const { data: ListData = [], loading } = bff.useListGpTs( @@ -62,16 +63,6 @@ const Agent = React.memo(({ agentData, cateData }) => { // agentData 是"推荐"选项的数据,所以非“推荐”选项的fallbackData数据就是[] { fallbackData: selectedTag ? [] : agentData } ); - const { data: cateList } = bff.useListGptCategory({}, { fallbackData: cateData }); - // const router = useRouter(); - // const searchParams = useSearchParams() - useEffect(() => { - // console.log(searchParams.get('classification')) - }, []); - - const getCateList = () => { - return cateList?.GPT?.listGPTCategory || []; - }; const handleSelectTagChange = tag => { setSelectedTags(tag); @@ -98,7 +89,7 @@ const Agent = React.memo(({ agentData, cateData }) => {
diff --git a/src/app/[locale]/chat/page.tsx b/src/app/[locale]/chat/page.tsx index 64c9f84..7905f0a 100644 --- a/src/app/[locale]/chat/page.tsx +++ b/src/app/[locale]/chat/page.tsx @@ -17,7 +17,7 @@ export default function Chat() { const router = useRouter(); const { locale } = useParams(); const [{ data }] = useAxiosRequest({ - url: '/kubeagi-apis/chat/conversations', + url: '/kubeagi-apis/gpts/chat/conversations', method: 'POST', }); React.useEffect(() => { diff --git a/src/app/[locale]/not-found.tsx b/src/app/[locale]/not-found.tsx index 4a6d9a4..87213c4 100644 --- a/src/app/[locale]/not-found.tsx +++ b/src/app/[locale]/not-found.tsx @@ -2,6 +2,7 @@ import { Button } from 'antd'; import { useTranslations } from 'next-intl'; +import Image from 'next/image'; import { useRouter } from 'next/navigation'; import * as React from 'react'; @@ -14,7 +15,9 @@ const NotFound = () => { return (
-
+
+ {'404'} +
{t('not_found.henBaoQianYeMian')}