This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useMouse } from '@uidotdev/usehooks'; | |
import * as React from 'react'; | |
interface Positions { | |
/* Sub-menu height */ | |
h: number; | |
/* Mouse x */ | |
mouseX: number; | |
/* Mouse y */ | |
mouseY: number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Computes the Levenshtein distance between two strings (a number that tells you how different two strings are). | |
* The higher the number, the more different the two strings are. | |
* Original source: https://gist.github.com/andrei-m/982927/0efdf215b00e5d34c90fdc354639f87ddc3bd0a5 | |
*/ | |
const getLevenshteinDistance = (a: string, b: string): number => { | |
if (a.length == 0) return b.length; | |
if (b.length == 0) return a.length; | |
const matrix = []; |