feat: add multi-select upload and unified selection bar on images page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -353,6 +353,16 @@ export function useImages() {
|
||||
}
|
||||
}, [items, uploadOne])
|
||||
|
||||
const uploadSelected = useCallback(async (ids: Set<string>) => {
|
||||
const toUpload = items.filter(i =>
|
||||
ids.has(i.id) && (i.status === 'ready' || i.status === 'converted') && !!i.shopifyProductId
|
||||
)
|
||||
for (const item of toUpload) {
|
||||
await uploadOne(item.id)
|
||||
await new Promise(r => setTimeout(r, 500))
|
||||
}
|
||||
}, [items, uploadOne])
|
||||
|
||||
const removeItem = useCallback((id: string) => {
|
||||
dispatch({ type: 'REMOVE', id })
|
||||
}, [])
|
||||
@@ -366,5 +376,5 @@ export function useImages() {
|
||||
[items, update],
|
||||
)
|
||||
|
||||
return { items, addFiles, setFeather, setAlphaThreshold, rotate, uploadOne, uploadAll, removeItem, assignProduct, reprocess, detour }
|
||||
return { items, addFiles, setFeather, setAlphaThreshold, rotate, uploadOne, uploadAll, uploadSelected, removeItem, assignProduct, reprocess, detour }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user