From 22bb4b63ce3820262336056aa8e5a9a0dfa0eb16 Mon Sep 17 00:00:00 2001
From: asepharyana
Date: Wed, 5 Aug 2026 20:59:56 +0700
Subject: [PATCH] feat(dimentorin): implementasi avatar inisial mentor + resume
dinamis + fix dummy data
- Komponen baru MentorAvatar: gradient unik per nama (hash), inisial nama, reusable (sm/md/lg + textClassName)
- Kartu mentor: ganti img testimonial.webp statis -> avatar inisial gradient (MU, dll)
- Detail mentor profile: avatar besar + fix hardcoded tanggal 'Jum, 4 April 2025' -> tanggal dinamis id-ID
- Senpai Resume: fallback dinamis dari data mentor (role/experience/expertise/industries/languages) saat bio kosong, bukan 'Belum ada deskripsi'
- Booking modal topic step: ganti nama mentor hardcoded 'Muhammad Firdaus Oi Oi Oi' -> dari prop mentor + avatar
- Booking modal payment step: avatar mentor di summary
---
.../_components/modals/appointment/index.tsx | 2 +-
.../modals/appointment/steps/payment.tsx | 8 ++-
.../modals/appointment/steps/topic.tsx | 19 +++--
.../[id]/_components/sections/profile.tsx | 16 ++++-
.../src/app/(public)/mentoring/[id]/page.tsx | 36 +++++++++-
.../mentoring/_components/mentor-avatar.tsx | 69 +++++++++++++++++++
.../mentoring/_components/mentor-card.tsx | 9 ++-
7 files changed, 145 insertions(+), 14 deletions(-)
create mode 100644 apps/dimentorin/src/app/(public)/mentoring/_components/mentor-avatar.tsx
diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/index.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/index.tsx
index 070776d..825d195 100644
--- a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/index.tsx
+++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/index.tsx
@@ -159,7 +159,7 @@ export const AppointmentModal: FC = ({ open, setOpen, mentorId, mentor })
)}
- {step === 'topic' && }
+ {step === 'topic' && }
{step === 'schedule' && setBooking(data)} />}
{step === 'profile' && }
{step === 'payment' && }
diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/payment.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/payment.tsx
index 117b4b1..64804de 100644
--- a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/payment.tsx
+++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/payment.tsx
@@ -3,6 +3,7 @@ import { FC, useState } from "react"
import { motion } from "framer-motion"
import { TOPICS } from "../../../sections/topics"
import { TBookSessionRequest } from "@imphnen-frontend-service/service"
+import { MentorAvatar } from "../../../../../_components/mentor-avatar"
type Props = {
selectedTopics: number[]
@@ -42,7 +43,12 @@ export const PaymentStep: FC = ({ selectedTopics, mentor, booking, onMeth
-

+
diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/topic.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/topic.tsx
index a2b139b..affe543 100644
--- a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/topic.tsx
+++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/modals/appointment/steps/topic.tsx
@@ -3,13 +3,19 @@ import { cn, For, Show } from "@imphnen-frontend-service/utils"
import { FC } from "react"
import { motion } from "framer-motion"
import { TOPICS } from "../../../sections/topics"
+import { MentorAvatar } from "../../../../../_components/mentor-avatar"
type Props = {
selectedTopics: number[]
setSelectedTopics: (topics: number[]) => void
+ mentor?: {
+ fullname?: string | null
+ current_role?: string
+ current_company?: string
+ }
}
-export const TopicStep: FC = ({ selectedTopics, setSelectedTopics }) => {
+export const TopicStep: FC = ({ selectedTopics, setSelectedTopics, mentor }) => {
const handleSelectTopic = (topicId: number) => {
if (selectedTopics.includes(topicId)) {
setSelectedTopics(selectedTopics.filter((id) => id !== topicId))
@@ -27,14 +33,19 @@ export const TopicStep: FC = ({ selectedTopics, setSelectedTopics }) => {
exit={{ opacity: 0, y: 20 }}
>
-

+
- Muhammad Firdaus Oi Oi Oi, S.H., M.H.
+ {mentor?.fullname || "Mentor"}
- UI Designer at Oray orayan Studios
+ {mentor?.current_role || "Mentor"} at {mentor?.current_company || "IMPHNEN"}
diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx
index 30f5e3e..0ad83e8 100644
--- a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx
+++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx
@@ -2,6 +2,7 @@ import { StarFilled } from "@ant-design/icons"
import { Button } from "@imphnen-frontend-service/ui/atoms"
import { cn, For } from "@imphnen-frontend-service/utils"
import { TMentorDetail } from "@imphnen-frontend-service/service"
+import { MentorAvatar } from "../../../_components/mentor-avatar"
type Props = {
onBook: () => void
@@ -31,7 +32,12 @@ export const ProfileSection: React.FC = ({ onBook, mentor }) => {
"xl:aspect-5/6 md:h-60 md:rounded-lg"
)}
>
-
+
@@ -89,8 +95,12 @@ export const ProfileSection: React.FC
= ({ onBook, mentor }) => {
-
Jum, 4 April 2025
-
Jum, 4 April 2025
+
+ {new Date().toLocaleDateString('id-ID', { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' })}
+
+
+ {new Date().toLocaleDateString('id-ID', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })}
+