diff --git a/.gitignore b/.gitignore index c6bba59..5f2add9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ + +/localData # Logs logs *.log diff --git a/package-lock.json b/package-lock.json index 26d0483..2908e57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "fs": "^0.0.1-security", "fs-extra": "^11.2.0", "json2csv": "^6.0.0-alpha.2", + "lodash": "^4.17.21", "next": "^14.2.12", "react": "^18", "react-dom": "^18", @@ -33,6 +34,7 @@ "@types/fs-extra": "^11.0.4", "@types/jest": "^29.5.13", "@types/json2csv": "^5.0.7", + "@types/lodash": "^4.17.13", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", @@ -2483,6 +2485,12 @@ "@types/node": "*" } }, + "node_modules/@types/lodash": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.13.tgz", + "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==", + "dev": true + }, "node_modules/@types/node": { "version": "20.10.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", @@ -6393,9 +6401,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, - "license": "MIT" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.get": { "version": "4.4.2", diff --git a/package.json b/package.json index e6eb581..97e6670 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "fs": "^0.0.1-security", "fs-extra": "^11.2.0", "json2csv": "^6.0.0-alpha.2", + "lodash": "^4.17.21", "next": "^14.2.12", "react": "^18", "react-dom": "^18", @@ -36,6 +37,7 @@ "@types/fs-extra": "^11.0.4", "@types/jest": "^29.5.13", "@types/json2csv": "^5.0.7", + "@types/lodash": "^4.17.13", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/src/app/components/Header/Header.tsx b/src/app/components/Header/Header.tsx index ac144fd..8fb7930 100644 --- a/src/app/components/Header/Header.tsx +++ b/src/app/components/Header/Header.tsx @@ -19,6 +19,7 @@ import { HEADER_DIALOGS_TITLES, } from "@/app/general/constants"; import { getTableInfo } from "@/app/general/utils"; +import _ from "lodash"; export default function Header({ bot }: HeaderProps) { const [openAttribute, setOpenAttribute] = useState(false); @@ -29,7 +30,7 @@ export default function Header({ bot }: HeaderProps) { const helpDescription = bot?._details.helpDescription; const mailInfo = bot?._details.mailInfo; const { botHeaders, botColumns, rows } = getTableInfo(bot); - const sampleRows = rows.slice(0, SAMPLE_SIZE); + const sampleRows = _.sampleSize(rows, SAMPLE_SIZE); const attributesRows = botColumns?.map((column) => ({ name: column.displayName,