-
- {!isLoading &&
- formatTime(
- getAudioDuration({ url: sourceState.source.url })
- )}
-
+ if (active.id !== over?.id) {
+ const oldIndex = audioSources.findIndex(source => source.source.url === active.id);
+ const newIndex = audioSources.findIndex(source => source.source.url === over?.id);
- {/* Direct delete button */}
- {canMutate && (
-
- )}
+ if (oldIndex !== -1 && newIndex !== -1) {
+ const newOrder = arrayMove(audioSources, oldIndex, newIndex);
+ const newUrls = newOrder.map(source => source.source.url);
- {/* Dropdown for re-uploading - Commented out for potential future use */}
- {/*
- e.stopPropagation()}
- >
-
-
- e.stopPropagation()}
- >
- {canMutate && (
- {
- const socket = useGlobalStore.getState().socket;
- if (!socket) return;
- sendWSRequest({
- ws: socket,
- request: {
- type: ClientActionEnum.enum
- .DELETE_AUDIO_SOURCES,
- urls: [sourceState.source.url],
- },
- });
- }}
- >
- Remove from queue
-
- )}
-
- */}
-
-