|
|
@ -5,9 +5,10 @@ import { MemberProgressModal } from './MemberProgressModal'; |
|
|
|
type MemberProgressItemProps = { |
|
|
|
type MemberProgressItemProps = { |
|
|
|
teamId: string; |
|
|
|
teamId: string; |
|
|
|
member: TeamMember; |
|
|
|
member: TeamMember; |
|
|
|
|
|
|
|
isMyProgress?: boolean; |
|
|
|
}; |
|
|
|
}; |
|
|
|
export function MemberProgressItem(props: MemberProgressItemProps) { |
|
|
|
export function MemberProgressItem(props: MemberProgressItemProps) { |
|
|
|
const { member, teamId } = props; |
|
|
|
const { member, teamId, isMyProgress = false } = props; |
|
|
|
|
|
|
|
|
|
|
|
const memberProgress = member?.progress?.sort((a, b) => { |
|
|
|
const memberProgress = member?.progress?.sort((a, b) => { |
|
|
|
return b.done - a.done; |
|
|
|
return b.done - a.done; |
|
|
@ -31,10 +32,10 @@ export function MemberProgressItem(props: MemberProgressItemProps) { |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
className="flex h-full min-h-[270px] flex-col rounded-md border" |
|
|
|
className={`flex h-full min-h-[270px] flex-col overflow-hidden rounded-md border`} |
|
|
|
key={member._id} |
|
|
|
key={member._id} |
|
|
|
> |
|
|
|
> |
|
|
|
<div className="flex items-center gap-3 border-b p-3"> |
|
|
|
<div className={`relative flex items-center gap-3 border-b p-3`}> |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={ |
|
|
|
src={ |
|
|
|
member.avatar |
|
|
|
member.avatar |
|
|
@ -44,8 +45,18 @@ export function MemberProgressItem(props: MemberProgressItemProps) { |
|
|
|
alt={member.name || ''} |
|
|
|
alt={member.name || ''} |
|
|
|
className="h-8 w-8 rounded-full" |
|
|
|
className="h-8 w-8 rounded-full" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div className="inline-grid"> |
|
|
|
<div className="inline-grid w-full"> |
|
|
|
<h3 className="truncate font-medium">{member.name}</h3> |
|
|
|
{!isMyProgress && ( |
|
|
|
|
|
|
|
<h3 className="truncate font-medium">{member.name}</h3> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{isMyProgress && ( |
|
|
|
|
|
|
|
<div className="inline-grid grid-cols-[auto,32px] items-center gap-1.5"> |
|
|
|
|
|
|
|
<h3 className="truncate font-medium">{member.name}</h3> |
|
|
|
|
|
|
|
<span className="rounded-md bg-red-500 text-center py-0.5 text-xs text-white"> |
|
|
|
|
|
|
|
You |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
)} |
|
|
|
<p className="truncate text-sm text-gray-500">{member.email}</p> |
|
|
|
<p className="truncate text-sm text-gray-500">{member.email}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -60,9 +71,11 @@ export function MemberProgressItem(props: MemberProgressItemProps) { |
|
|
|
> |
|
|
|
> |
|
|
|
<span className="relative z-10 flex items-center justify-between text-sm"> |
|
|
|
<span className="relative z-10 flex items-center justify-between text-sm"> |
|
|
|
<span className="inline-grid"> |
|
|
|
<span className="inline-grid"> |
|
|
|
<span className={'truncate'}>{progress.resourceTitle}</span> |
|
|
|
<span className={'truncate'}> |
|
|
|
|
|
|
|
{progress.resourceTitle} |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="text-xs text-gray-400 shrink-0 ml-1.5"> |
|
|
|
<span className="ml-1.5 shrink-0 text-xs text-gray-400"> |
|
|
|
{progress.done} / {progress.total} |
|
|
|
{progress.done} / {progress.total} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|