fix: projects fix in permissions

This commit is contained in:
ivannoskov
2026-02-10 18:26:21 +03:00
parent f0574db79f
commit 77a41d6c2a

View File

@@ -359,7 +359,7 @@ export function PermissionModal({
onClick={() => handleToggleProject(key, project.id)} onClick={() => handleToggleProject(key, project.id)}
> >
<Avatar className="h-6 w-6 shrink-0"> <Avatar className="h-6 w-6 shrink-0">
<AvatarImage src={project.username ? undefined : undefined} /> <AvatarImage src={project.username ? `https://t.me/i/userpic/320/${project.username}.jpg` : undefined} />
<AvatarFallback className="text-xs"> <AvatarFallback className="text-xs">
{project.title.charAt(0).toUpperCase()} {project.title.charAt(0).toUpperCase()}
</AvatarFallback> </AvatarFallback>
@@ -400,19 +400,19 @@ export function PermissionModal({
className={cn("gap-1 text-xs", isDisabled && "opacity-50")} className={cn("gap-1 text-xs", isDisabled && "opacity-50")}
> >
<Avatar className="h-4 w-4"> <Avatar className="h-4 w-4">
<AvatarImage src={project?.username ? `https://t.me/i/userpic/320/${project.username}.jpg` : undefined} />
<AvatarFallback className="text-[10px]"> <AvatarFallback className="text-[10px]">
{project?.title.charAt(0).toUpperCase() || "?"} {project?.title.charAt(0).toUpperCase() || "?"}
</AvatarFallback> </AvatarFallback>
</Avatar> </Avatar>
<span className="truncate max-w-[150px]">{project?.title || "Unknown"}</span> <span className="truncate max-w-[150px]">{project?.title || "Unknown"}</span>
<X <span
className={cn( className={cn(
"h-3 w-3 ml-1", "h-3 w-3 ml-1 cursor-pointer hover:text-destructive",
isDisabled isDisabled && "cursor-not-allowed text-muted-foreground/50"
? "cursor-not-allowed text-muted-foreground/50"
: "cursor-pointer hover:text-destructive"
)} )}
onClick={() => { onClick={(e) => {
e.stopPropagation();
if (isDisabled) return; if (isDisabled) return;
setPermissions((prev) => { setPermissions((prev) => {
const existing = prev.find((p) => p.key === key); const existing = prev.find((p) => p.key === key);
@@ -426,7 +426,9 @@ export function PermissionModal({
); );
}); });
}} }}
/> >
<X className="h-3 w-3" />
</span>
</Badge> </Badge>
); );
})} })}