[offers][feat] add random name generator

This commit is contained in:
Stuart Long Chay Boon
2022-10-24 20:56:28 +08:00
parent 65a8618e54
commit ef5892a0d6
3 changed files with 19 additions and 0 deletions

View File

@ -38,6 +38,7 @@
"react-popper-tooltip": "^4.4.2",
"react-query": "^3.39.2",
"superjson": "^1.10.0",
"unique-names-generator": "^4.7.1",
"zod": "^3.18.0"
},
"devDependencies": {

View File

@ -0,0 +1,13 @@
import type { Config } from 'unique-names-generator';
import { adjectives, animals,colors, uniqueNamesGenerator } from 'unique-names-generator';
const customConfig: Config = {
dictionaries: [adjectives, colors, animals],
length: 3,
separator: '-',
};
export default function generateRandomName(): string {
return uniqueNamesGenerator(customConfig)
}