Created
February 22, 2023 16:50
-
-
Save dueka/7c5c7a0c225c748e63a7279097ad17fa to your computer and use it in GitHub Desktop.
Create random data
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
interface IData { | |
name?: string; | |
department?: string; | |
teamlead?: string; | |
role?: string; | |
location?: string; | |
lga?: string; | |
country?: string; | |
due_date?: string; | |
children?: JSX.Element | JSX.Element[]; | |
// view?: () => null; | |
} | |
export const DATA: IData[] = []; | |
export function createRandomData(): IData { | |
return { | |
name: faker.name.fullName(), | |
department: faker.commerce.department(), | |
teamlead: faker.name.fullName(), | |
role: faker.random.word(), | |
location: faker.address.secondaryAddress(), | |
lga: faker.address.streetAddress(), | |
country: faker.address.country(), | |
due_date: faker.commerce.price(), | |
}; | |
} | |
Array.from({ length: 50 }).forEach(() => { | |
DATA.push(createRandomData()); | |
}); | |
// header for data table | |
const header = [ | |
{ title: "NAME", prop: "NAME" }, | |
{ title: "DEPARTMENT", prop: "DEPARTMENT" }, | |
{ title: "TEAM LEAD", prop: "team_lead" }, | |
{ title: "ROLE", prop: "role" }, | |
{ title: "LOCATION", prop: "location" }, | |
{ title: "LGA", prop: "lga" }, | |
{ title: "COUNTRY", prop: "country" }, | |
{ title: "DUE DATE", prop: "due_date" }, | |
{ title: "VIEW", prop: "view" }, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment