mirror of
https://github.com/codeforreal1/compressO
synced 2026-04-21 15:47:56 +00:00
feat: Upgrade to taur v2.0.0 stable from beta
This commit is contained in:
parent
6b8b914835
commit
3ae8548a50
5 changed files with 99 additions and 95 deletions
|
|
@ -3,4 +3,4 @@
|
|||
set -e
|
||||
|
||||
pnpm lint-staged
|
||||
pnpm tsc --noEmit --skipLibCheck
|
||||
pnpm tsc:check
|
||||
15
package.json
15
package.json
|
|
@ -18,7 +18,8 @@
|
|||
"tauri:build:debug": "tauri build --debug",
|
||||
"pnpm:devPreinstall": "fnm use",
|
||||
"postinstall": "husky install",
|
||||
"lint-staged": "lint-staged"
|
||||
"lint-staged": "lint-staged",
|
||||
"tsc:check": "tsc --noEmit --skipLibCheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@heroui/button": "2.2.10",
|
||||
|
|
@ -42,11 +43,11 @@
|
|||
"@heroui/use-theme": "^2.1.2",
|
||||
"@tanstack/react-router": "^1.97.21",
|
||||
"@tanstack/router-devtools": "^1.97.21",
|
||||
"@tauri-apps/api": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-beta.3",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-beta.3",
|
||||
"@tauri-apps/plugin-os": "2.0.0-beta.5",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-beta.3",
|
||||
"@tauri-apps/api": "2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0",
|
||||
"@tauri-apps/plugin-fs": "2.0.0",
|
||||
"@tauri-apps/plugin-os": "2.0.0",
|
||||
"@tauri-apps/plugin-shell": "2.0.0",
|
||||
"clsx": "^2.0.0",
|
||||
"framer-motion": "11.18.2",
|
||||
"lodash": "^4.17.21",
|
||||
|
|
@ -62,7 +63,7 @@
|
|||
"devDependencies": {
|
||||
"@biomejs/biome": "2.3.2",
|
||||
"@tanstack/router-plugin": "^1.97.22",
|
||||
"@tauri-apps/cli": ">=2.0.0-beta.0",
|
||||
"@tauri-apps/cli": "^2.9.2",
|
||||
"@types/lodash": "^4.17.4",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
|
|
|
|||
165
pnpm-lock.yaml
165
pnpm-lock.yaml
|
|
@ -72,20 +72,20 @@ importers:
|
|||
specifier: ^1.97.21
|
||||
version: 1.97.21(@tanstack/react-router@1.97.21(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@tauri-apps/api':
|
||||
specifier: '>=2.0.0-beta.0'
|
||||
version: 2.0.0-beta.11
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
'@tauri-apps/plugin-dialog':
|
||||
specifier: 2.0.0-beta.3
|
||||
version: 2.0.0-beta.3
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
'@tauri-apps/plugin-fs':
|
||||
specifier: 2.0.0-beta.3
|
||||
version: 2.0.0-beta.3
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
'@tauri-apps/plugin-os':
|
||||
specifier: 2.0.0-beta.5
|
||||
version: 2.0.0-beta.5
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
'@tauri-apps/plugin-shell':
|
||||
specifier: 2.0.0-beta.3
|
||||
version: 2.0.0-beta.3
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
clsx:
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
|
|
@ -127,8 +127,8 @@ importers:
|
|||
specifier: ^1.97.22
|
||||
version: 1.97.22(@tanstack/react-router@1.97.21(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@6.0.11(@types/node@20.9.0)(jiti@2.4.2)(lightningcss@1.29.1)(tsx@4.19.2))
|
||||
'@tauri-apps/cli':
|
||||
specifier: '>=2.0.0-beta.0'
|
||||
version: 2.0.0-beta.15
|
||||
specifier: ^2.9.2
|
||||
version: 2.9.2
|
||||
'@types/lodash':
|
||||
specifier: ^4.17.4
|
||||
version: 4.17.4
|
||||
|
|
@ -2862,90 +2862,91 @@ packages:
|
|||
resolution: {integrity: sha512-wGrY0o997lg/xlMlhhJdJHxdllG+cPXnMb1oeaxijL9wqUUnKwAUERoPeKZRLFhuhfH//4cmXsHF23d0F7qGWA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.11':
|
||||
resolution: {integrity: sha512-wJRY+fBUm3KpqZDHMIz5HRv+1vlnvRJ/dFxiyY3NlINTx2qXqDou5qWYcP1CuZXsd39InWVPV3FAZvno/kGCkA==}
|
||||
engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
'@tauri-apps/api@2.0.0':
|
||||
resolution: {integrity: sha512-moKgCp2EX7X5GiOx/G/bmoEpkFQVVmyS98UaJU4xUVzan+E1BdwlAKcbip+cGldshYOqL4JSwAEN1OkRXeug0Q==}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.13':
|
||||
resolution: {integrity: sha512-Np1opKANzRMF3lgJ9gDquBCB9SxlE2lRmNpVx1+L6RyzAmigkuh0ZulT5jMnDA3JLsuSDU135r/s4t/Pmx4atg==}
|
||||
engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-M4owBLoRdJb2/IK48KOQDU3j5xrjqGxa539rDXMjvaKydBk8x+aLdk3xZNsk/owHTI1GnrQZsPCMQaOgetYHaw==}
|
||||
'@tauri-apps/cli-darwin-arm64@2.9.2':
|
||||
resolution: {integrity: sha512-g1OtCXydOZFYRUEAyGYdJ2lLaE3l5jk8o+Bro8y2WOLwBLtbWjBoJIVobOKFanfjG/Xr8H/UA+umEVILPhMc2A==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-ECpatfJdT4xKyFoE7tNEtTUIRxjQ2XSXa0TQkP3g7Kn7H/jRse+7pYe69jASA7shixajatAwmD4bXNT8jYRyNA==}
|
||||
'@tauri-apps/cli-darwin-x64@2.9.2':
|
||||
resolution: {integrity: sha512-nHHIY33noUmMOyFwAJz0xQyrYIXU+bae8MNos4TGsTo491YWAF2uzr6iW+Bq0N530xDcbe7EyRvDHgK43RmmVw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-GQz2nnPwIamzDbmmfGWvmmoLthOkOBs0RO5u72KYAa78ZRFTx7S6AovnxJv48Fq+zeGGdDKoD9+ZG2Ue+sCL4w==}
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.2':
|
||||
resolution: {integrity: sha512-Dq17LBdSuzf+fWOKMIyiSao+Fcq4FiQwYYlx3Nk8oafDINc8sVBjC5gv2xp18KzYhk9teSWfmDpD1sj+D3t7uw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-YBIfq0GbmIsWmRy6dVuDv3oMJN7a3R8HGVPMsa1W526AdCxoZDiPOQpSQN4VihJlbebUHxS/HyYF6maCY8uGzA==}
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.9.2':
|
||||
resolution: {integrity: sha512-Pxj5k29Rxj9xEht4gdE744t5HLXTwBojkjYDXXyJ3mE+BEg9hFX5WkStg7OkyZwH60u8NSkDSMpo7MJTH9srmA==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-2ZBXoShz7UfqVGmc85mhwjI6ckdtrk15V69adxt/x+VS68yK6Ddbj+yqlffpeFNL90fZrsVhFoRIDqgkxtwksQ==}
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.9.2':
|
||||
resolution: {integrity: sha512-mx82BuD4q3Yj5Zw+LXveZgPaDCnmH2At2LosX1siK77kaD5Ap5FF+FN0V4y+3cwq+Hcrk9AhEUPbHqoNOx1R2g==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-cwJqIIdc4Kq9sBl/vYc+Y95iMe+mlTYUj7ZnSn4YAbLKFz432bGg6uBn2qHXFN5jzwXtEOVZiB1zDZ2kveVoAQ==}
|
||||
'@tauri-apps/cli-linux-riscv64-gnu@2.9.2':
|
||||
resolution: {integrity: sha512-Ypm1nnr7k+ECC1+JfDcnxROHt6BX8t/4GplxBvdY68BDXtIcBbdhPWDos7MK+3bDmoaA0WSJbW+DUjpfSkyKgw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.9.2':
|
||||
resolution: {integrity: sha512-tg85cGIM9PWwsbQg8m3uah3SfoNapgUr4vhWtkqgeTDZOjQuQ2duTwCH4UiM7acBpbZHNzvRrxSFpv0U53TqQQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-nNuxZ8/qs0vQbdLO2hovskZGxwGn2z4x1QFJuL4xwd6Tryy9vVcznvyZS+t/72dCLoIkY9pKZQq5nYtAHYfTEg==}
|
||||
'@tauri-apps/cli-linux-x64-musl@2.9.2':
|
||||
resolution: {integrity: sha512-xW8qaz9bcwR35W2gIg7fKG9e1Z34idOsGpD2zIPgxlJyF314B/1qie50hbOqt5AbbXHR4iRpxKE4kA2grqMmkg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-DXiXMTE00INjBkTgq1CYduMWgUwQ0NvLw+uXfu8BUupA+aOlv9ODhsGu7bZSaxKx4/glwxNAGZum4kQ0E0AxUg==}
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.9.2':
|
||||
resolution: {integrity: sha512-A1PshB8oHdY7zYOPlLD7Om7/aD9sOUVREd765ElIzYDtptWcALwOP9jb22Wi01vDTqxf98E4ZGIcG2gxr4FhiA==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-ajEQdW2jx2raPp7eDYryJkbBrgI8PIY1dz5ro8FweRrRmbotaUlclsro1kfNMQrfDah8+qfwnRvW3MahOBE5Wg==}
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.9.2':
|
||||
resolution: {integrity: sha512-AuCi0Vnc4qkXRLCC58das0u45SmXAjqcOjqF324CBKa1Z7jjNJESm0Sc2oc2G2q6f2eAbAfi34s2iJNaJU1hlQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-yzsSgoiY0PmFiR5LvVOFr1b7h9l3aLPPQFlDG6+kRMrxCo7x7Pbyh4D5cqiMUuZO0QacwSP38EH6w0F88Y+4OA==}
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.9.2':
|
||||
resolution: {integrity: sha512-kDoejyfvME/mLkR4VofQnmVPTt/smJvoXuE3xgTbUwcUQKqawM8EyQvxOHQosaJYfQphHi7G0ya8UZo3PlDZig==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli@2.0.0-beta.15':
|
||||
resolution: {integrity: sha512-3pCvc54QfsRY+i9B7w3Q5jPAGtf8p+g7N/BamWPeiW6YqDqbHi9rNVI3SzrHkRRNOJnzMW8E5a8G0HziOluZGg==}
|
||||
'@tauri-apps/cli@2.9.2':
|
||||
resolution: {integrity: sha512-aGzdVgxQW6WQ7e5nydPZ/30u8HvltHjO3Ytzf1wOxX1N5Yj2TsjKWRb/AWJlB95Huml3k3c/b6s0ijAvlSo9xw==}
|
||||
engines: {node: '>= 10'}
|
||||
hasBin: true
|
||||
|
||||
'@tauri-apps/plugin-dialog@2.0.0-beta.3':
|
||||
resolution: {integrity: sha512-B3KxLjFxCVB3AIYWN/xY9HM6tO7m4u6aQk1t0ZrBToXThowRU9f62527EO0oj0uNlyKlXx20up68NkpdlER0yg==}
|
||||
'@tauri-apps/plugin-dialog@2.0.0':
|
||||
resolution: {integrity: sha512-ApNkejXP2jpPBSifznPPcHTXxu9/YaRW+eJ+8+nYwqp0lLUtebFHG4QhxitM43wwReHE81WAV1DQ/b+2VBftOA==}
|
||||
|
||||
'@tauri-apps/plugin-fs@2.0.0-beta.3':
|
||||
resolution: {integrity: sha512-LBgA7S10NwcitHaugIfmCSkewz45vSz1VOpMHhzvE38i1r1KpuTSHlr3MZ0LLq93tH/lvhYZ+3LAml4Sriwthw==}
|
||||
'@tauri-apps/plugin-fs@2.0.0':
|
||||
resolution: {integrity: sha512-BNEeQQ5aH8J5SwYuWgRszVyItsmquRuzK2QRkVj8Z0sCsLnSvJFYI3JHRzzr3ltZGq1nMPtblrlZzuKqVzRawA==}
|
||||
|
||||
'@tauri-apps/plugin-os@2.0.0-beta.5':
|
||||
resolution: {integrity: sha512-Qfs/clZ9R05J+OVOGkko+9OaYaL+xJaGICeQ1G5CnLFpUdTfMV10D+1nBBauxDdiLU4ay5I0iprJ5aG5GJBunQ==}
|
||||
'@tauri-apps/plugin-os@2.0.0':
|
||||
resolution: {integrity: sha512-M7hG/nNyQYTJxVG/UhTKhp9mpXriwWzrs9mqDreB8mIgqA3ek5nHLdwRZJWhkKjZrnDT4v9CpA9BhYeplTlAiA==}
|
||||
|
||||
'@tauri-apps/plugin-shell@2.0.0-beta.3':
|
||||
resolution: {integrity: sha512-iSFKUJzmdBE194J0q2O3nWgO86tApVsB9kKD4UkB4YNGTIz09hgeXsOIEo3bMfJEmQe54H/zPBzPo9TeuZZFGA==}
|
||||
'@tauri-apps/plugin-shell@2.0.0':
|
||||
resolution: {integrity: sha512-OpW2+ycgJLrEoZityWeWYk+6ZWP9VyiAfbO+N/O8VfLkqyOym8kXh7odKDfINx9RAotkSGBtQM4abyKfJDkcUg==}
|
||||
|
||||
'@types/babel__core@7.20.5':
|
||||
resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
|
||||
|
|
@ -8033,68 +8034,70 @@ snapshots:
|
|||
|
||||
'@tanstack/virtual-file-routes@1.97.8': {}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.11': {}
|
||||
'@tauri-apps/api@2.0.0': {}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.13': {}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-darwin-arm64@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-darwin-x64@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-riscv64-gnu@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-linux-x64-musl@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli@2.0.0-beta.15':
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.9.2':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli@2.9.2':
|
||||
optionalDependencies:
|
||||
'@tauri-apps/cli-darwin-arm64': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-darwin-x64': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-linux-arm64-gnu': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-linux-arm64-musl': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-linux-x64-gnu': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-linux-x64-musl': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-win32-arm64-msvc': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-win32-x64-msvc': 2.0.0-beta.15
|
||||
'@tauri-apps/cli-darwin-arm64': 2.9.2
|
||||
'@tauri-apps/cli-darwin-x64': 2.9.2
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf': 2.9.2
|
||||
'@tauri-apps/cli-linux-arm64-gnu': 2.9.2
|
||||
'@tauri-apps/cli-linux-arm64-musl': 2.9.2
|
||||
'@tauri-apps/cli-linux-riscv64-gnu': 2.9.2
|
||||
'@tauri-apps/cli-linux-x64-gnu': 2.9.2
|
||||
'@tauri-apps/cli-linux-x64-musl': 2.9.2
|
||||
'@tauri-apps/cli-win32-arm64-msvc': 2.9.2
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 2.9.2
|
||||
'@tauri-apps/cli-win32-x64-msvc': 2.9.2
|
||||
|
||||
'@tauri-apps/plugin-dialog@2.0.0-beta.3':
|
||||
'@tauri-apps/plugin-dialog@2.0.0':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.11
|
||||
'@tauri-apps/api': 2.0.0
|
||||
|
||||
'@tauri-apps/plugin-fs@2.0.0-beta.3':
|
||||
'@tauri-apps/plugin-fs@2.0.0':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.11
|
||||
'@tauri-apps/api': 2.0.0
|
||||
|
||||
'@tauri-apps/plugin-os@2.0.0-beta.5':
|
||||
'@tauri-apps/plugin-os@2.0.0':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.13
|
||||
'@tauri-apps/api': 2.0.0
|
||||
|
||||
'@tauri-apps/plugin-shell@2.0.0-beta.3':
|
||||
'@tauri-apps/plugin-shell@2.0.0':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.11
|
||||
'@tauri-apps/api': 2.0.0
|
||||
|
||||
'@types/babel__core@7.20.5':
|
||||
dependencies:
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ function Root() {
|
|||
containerProps={{ className: 'relative' }}
|
||||
childrenProps={{ className: 'm-auto' }}
|
||||
>
|
||||
<VideoPicker onSuccess={({ file }) => handleVideoSelected(file?.path)}>
|
||||
<VideoPicker onSuccess={({ filePath }) => handleVideoSelected(filePath)}>
|
||||
{({ onClick }) => (
|
||||
<motion.div
|
||||
role="button"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { FileResponse, open } from '@tauri-apps/plugin-dialog'
|
||||
import { open } from '@tauri-apps/plugin-dialog'
|
||||
|
||||
import { extensions } from '@/types/compression'
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ type Error = {
|
|||
|
||||
type VideoPickerProps = {
|
||||
children: (_: ChildrenFnParams) => React.ReactNode
|
||||
onSuccess?: (_: { file: FileResponse }) => void
|
||||
onSuccess?: (_: { filePath: string }) => void
|
||||
onError?: (_: Error) => void
|
||||
}
|
||||
|
||||
|
|
@ -24,20 +24,20 @@ export default function VideoPicker({
|
|||
}: VideoPickerProps) {
|
||||
async function onClick() {
|
||||
try {
|
||||
const file = await open({
|
||||
const filePath = await open({
|
||||
directory: false,
|
||||
multiple: false,
|
||||
title: 'Select video to compress',
|
||||
filters: [{ name: 'video', extensions: videoExtensions }],
|
||||
})
|
||||
if (file == null) {
|
||||
if (filePath == null) {
|
||||
const message = 'File selection config is invalid.'
|
||||
// biome-ignore lint/suspicious/noConsole: <>
|
||||
console.warn(message)
|
||||
onError?.({ message })
|
||||
return
|
||||
}
|
||||
onSuccess?.({ file })
|
||||
onSuccess?.({ filePath })
|
||||
} catch (error: any) {
|
||||
onError?.({
|
||||
message: error?.message ?? 'Could not select video.',
|
||||
|
|
|
|||
Loading…
Reference in a new issue