Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit e33238be authored by Ryan Karyadiputera's avatar Ryan Karyadiputera
Browse files

change button name

parent ff0e4e31
Branches
No related tags found
1 merge request!31add alert message for custom input
import { equals } from 'ramda'; import { equals, isEmpty } from 'ramda';
import { useState } from 'react'; import { useState } from 'react';
import { useSelectionSort, useBubbleSort, useInsertionSort, useCombSort, useShellSort, useCountingSort } from '../../hooks/algorithm'; import { useSelectionSort, useBubbleSort, useInsertionSort, useCombSort, useShellSort, useCountingSort } from '../../hooks/algorithm';
import { calculateColumnWidth, getRandomArray, getArray } from '../useFunctions/useFunctions'; import { calculateColumnWidth, getRandomArray, getArray } from '../useFunctions/useFunctions';
...@@ -76,7 +76,11 @@ function Preview({ useSort } : PreviewProps) { ...@@ -76,7 +76,11 @@ function Preview({ useSort } : PreviewProps) {
} }
const handleCreateCustomArray = () => { const handleCreateCustomArray = () => {
setColumnsArray(getArray(max, 1, stringToArray(customArray))); if(isEmpty(customArray.replace(/\D/g, ''))){
alert("input doesn't contain any numbers");
} else {
setColumnsArray(getArray(max, 1, stringToArray(customArray)));
}
} }
console.log(highlight); console.log(highlight);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment