diff --git a/src/app/[language]/projetos/[id]/page-content.tsx b/src/app/[language]/projetos/[id]/page-content.tsx
index 49522dc..46c20e6 100644
--- a/src/app/[language]/projetos/[id]/page-content.tsx
+++ b/src/app/[language]/projetos/[id]/page-content.tsx
@@ -3,7 +3,7 @@
import { useState } from "react";
import { useParams } from "next/navigation";
import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { ArrowLeft, Lightbulb, Plus, Users, X } from "lucide-react";
+import { ArrowLeft, Lightbulb, Pencil, Plus, X } from "lucide-react";
import {
useDeleteProjectInterestService,
useDeleteProjectParticipantService,
@@ -16,7 +16,12 @@ import {
usePutProjectInterestService,
} from "@/services/api/services/projects";
import HTTP_CODES_ENUM from "@/services/api/types/http-codes";
-import { ProjectIdea, ProjectParticipant } from "@/services/api/types/project";
+import {
+ ProjectIdea,
+ ProjectIdeaStatus,
+ ProjectParticipant,
+ ProjectUserSummary,
+} from "@/services/api/types/project";
import { RoleEnum } from "@/services/api/types/role";
import { Button } from "@/components/ui/button";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
@@ -24,16 +29,53 @@ import Link from "@/components/link";
import { EmptyState } from "@/components/ui/empty-state";
import useAuth from "@/services/auth/use-auth";
import { useSnackbar } from "@/hooks/use-snackbar";
-import { getApiError } from "@/lib/utils";
-import { projectUserName } from "@/lib/project-labels";
-import { FIELD_CLASS, UserChip } from "../project-components";
+import { cn, getApiError } from "@/lib/utils";
+import { projectRoleFromLabel, projectUserName } from "@/lib/project-labels";
+import { FIELD_CLASS } from "../project-components";
const MAX_STACK = 4;
+const MAX_NAMES = 3;
+
+const AVATAR_COLORS = [
+ "bg-[#2f5fd8]",
+ "bg-[#b4540a]",
+ "bg-[#0f7b6c]",
+ "bg-[#8a3fd1]",
+ "bg-[#c0357a]",
+ "bg-[#4d6b1f]",
+];
+
+function avatarColor(userId: number): string {
+ return AVATAR_COLORS[Math.abs(userId) % AVATAR_COLORS.length];
+}
-function participantLabel(participant: ProjectParticipant): string {
- return participant.user?.username
- ? `@${participant.user.username}`
- : projectUserName(participant.user);
+function handleOf(user?: ProjectUserSummary | null): string {
+ return user?.username ? `@${user.username}` : projectUserName(user);
+}
+
+function initialOf(user?: ProjectUserSummary | null): string {
+ return projectUserName(user).charAt(0).toUpperCase();
+}
+
+function PersonAvatar({
+ user,
+ userId,
+ className,
+}: {
+ user?: ProjectUserSummary | null;
+ userId: number;
+ className?: string;
+}) {
+ return (
+
+
-
- Escolha um ou mais cargos para participar. Quem propôs o projeto - também pode atuar nele. -
++ Entre em um ou mais cargos. Quem propôs o projeto também pode atuar + nele + {canManage ? ", e você pode criar cargos novos." : "."} +
+{role.name}
- {inRole.length === 0 ? ( -Vaga aberta
- ) : ( -- {inRole.map((participant) => ( - - {participant.user?.username ? ( - - {participantLabel(participant)} - - ) : ( - participantLabel(participant) - )} - {canManage && ( - - )} - - ))} -
- )} -+ {(manage ? inRole : inRole.slice(0, MAX_NAMES)).map( + (participant, index, list) => ( + + {participant.user?.username ? ( + + {handleOf(participant.user)} + + ) : ( + handleOf(participant.user) + )} + {manage ? ( + + ) : ( + index < list.length - 1 && "," + )} + + ) + )} + {!manage && inRole.length > MAX_NAMES && ( + e mais {inRole.length - MAX_NAMES} + )} +
+ > + )} +- {idea.description} -
- {idea.teamId && (Este projeto já tem um time.
@@ -444,7 +592,16 @@ function ProjectIdeaDetailPageContent() {+ {idea.description} +
+