diff --git a/src/components/ProfileInfo/ProfileBio/ProfileBio.tsx b/src/components/ProfileInfo/ProfileBio/ProfileBio.tsx index 7607ea51..28ff716d 100644 --- a/src/components/ProfileInfo/ProfileBio/ProfileBio.tsx +++ b/src/components/ProfileInfo/ProfileBio/ProfileBio.tsx @@ -1,11 +1,10 @@ import { Link } from 'react-router-dom'; import { ProfileImage } from '@/components/ProfileImage/ProfileImage'; -import { getFullName, getProfileImageUrl } from '@/utils/profileUtils'; import { ICON_EDIT_WHITE } from '@/utils/assets'; import { groupBannerUrl } from '@/utils/apiUtils'; -import type { Profile } from '@/types/Profile'; +import { type Profile, ProfileClass } from '@/types/Profile'; import { TypeLinkToBootstrapIcon, type Link as Link_API } from '@/types/Link'; import type { Group } from '@/types/Group'; import './ProfileBio.less'; @@ -26,6 +25,8 @@ export function ProfileBio(props: ProfileBioProps) { ? { backgroundImage: `url(${groupBannerUrl(props.organization)})` } : { backgroundColor: "var(--primary-color)" } + const profile = new ProfileClass(props.profile); + return (
Esse grupo não possui participantes.
} @@ -41,7 +40,7 @@ function makePeopleList(people: Profile[], filter: string) { const lowercaseFilter = filter.toLowerCase(); const filteredPeople = filter.length === 0 ? people - : people.filter(p => (getFullName(p)).toLowerCase().includes(lowercaseFilter)); + : people.filter(p => (p.fullname ?? "").toLowerCase().includes(lowercaseFilter)); if (filteredPeople.length === 0) { returnNenhum participante encontrado com a pesquisa.
@@ -52,7 +51,7 @@ function makePeopleList(people: Profile[], filter: string) { .map(renderPerson); } -function renderPerson(person: Profile) { +function renderPerson(person: ProfileClass) { const linkToProfile = `/profile/${person.user.name}`; const imageUrl = person.image?.startsWith("/") @@ -66,7 +65,7 @@ function renderPerson(person: Profile) {{person.bio}