import { useEffect, useState } from "react"; import { Link, useParams } from "react-router-dom"; import { ArrowLeft, KeyRound, MessageCircle, Shield, User, } from "lucide-react"; import { Badge } from "../../components/ui/badge"; import { Button } from "../../components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "../../components/ui/card"; import { Avatar, AvatarFallback, AvatarImage } from "../../components/ui/avatar"; import { cn } from "../../lib/utils"; import { getTeamMemberById } from "../../api/team.api"; import type { TeamMember } from "../../types/team.types"; function formatRoleLabel(role: string): string { return role .split("_") .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) .join(" "); } function formatEmploymentType(type: string): string { return type .split("_") .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) .join(" "); } function getRoleBadgeClasses(role: string): string { switch (role) { case "super_admin": return "bg-brand-500/15 text-brand-600 border border-brand-500/25"; case "admin": return "bg-brand-100 text-brand-600 border border-brand-200"; case "content_manager": return "bg-mint-100 text-mint-500 border border-mint-300/40"; case "instructor": return "bg-gold-100 text-gold-600 border border-gold-300/40"; case "support_agent": return "bg-orange-100 text-orange-600 border border-orange-200"; case "finance": return "bg-sky-100 text-sky-600 border border-sky-200"; case "hr": return "bg-pink-100 text-pink-600 border border-pink-200"; case "analyst": return "bg-violet-100 text-violet-600 border border-violet-200"; default: return "bg-grayScale-100 text-grayScale-600 border border-grayScale-200"; } } function ReadOnlyField({ label, value }: { label: string; value: string }) { return (
This is the profile page. You can see the progress made with their work and manage their projects or assigned tasks
{member.job_title}
{/* Action buttons */}Role
Status
{member.status === "active" ? "Active" : "Inactive"}
Type
{formatEmploymentType(member.employment_type)}