diff --git a/apps/portal/package.json b/apps/portal/package.json index 208b1940..a8a184d8 100644 --- a/apps/portal/package.json +++ b/apps/portal/package.json @@ -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": { diff --git a/apps/portal/src/utils/offers/randomNameGenerator.ts b/apps/portal/src/utils/offers/randomNameGenerator.ts new file mode 100644 index 00000000..ba286197 --- /dev/null +++ b/apps/portal/src/utils/offers/randomNameGenerator.ts @@ -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) +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f5517ea1..f2dd81c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14405,6 +14405,11 @@ unique-filename@^1.1.1: dependencies: unique-slug "^2.0.0" +unique-names-generator@^4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597" + integrity sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow== + unique-slug@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"