Add button and custom modal flow implemented

This commit is contained in:
adilallo
2026-05-07 21:15:27 -06:00
parent dee2dd800e
commit 26bcd61ea3
43 changed files with 1444 additions and 81 deletions
@@ -0,0 +1,18 @@
/**
* Immutable reorder for custom method card field blocks (wizard step 3, edit modal).
*/
export function reorderCustomMethodCardFieldBlocks<T>(
blocks: readonly T[],
fromIndex: number,
toIndex: number,
): T[] {
if (fromIndex === toIndex) return [...blocks];
if (fromIndex < 0 || toIndex < 0 || fromIndex >= blocks.length) {
return [...blocks];
}
if (toIndex >= blocks.length) return [...blocks];
const next = [...blocks];
const [removed] = next.splice(fromIndex, 1);
next.splice(toIndex, 0, removed);
return next;
}