From 2b145b2bde18b375be7994254c5877827249dcfc Mon Sep 17 00:00:00 2001 From: danieltomefernandez Date: Wed, 18 Sep 2024 21:34:25 +0200 Subject: [PATCH] Refactor code --- packages/nextjs/app/builders/page.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/nextjs/app/builders/page.tsx b/packages/nextjs/app/builders/page.tsx index a711fd4..6fd49db 100644 --- a/packages/nextjs/app/builders/page.tsx +++ b/packages/nextjs/app/builders/page.tsx @@ -17,17 +17,11 @@ const getRandomUserImage = () => { return `https://randomuser.me/api/portraits/${randomGender}/${randomInt}.jpg`; }; -const getBuilderFromEvent = (event: any): Builder => { - const args = event.args; - - const person: Builder = { - image: getRandomUserImage(), - link: "builders/" + args.builder, - checkedIn: true, - }; - - return person; -}; +const getBuilderFromEvent = (event: any): Builder => ({ + image: getRandomUserImage(), + link: "builders/" + event.args.builder, + checkedIn: true, +}); const mentors: Mentor[] = [ {