完善客户端模块与工作区能力
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { isProjectAgentAvatarDataUrl } from '../../shared/project-config';
|
||||
|
||||
const avatarModules = import.meta.glob('../assets/agent-avatars/avatar-*.png', {
|
||||
eager: true,
|
||||
import: 'default',
|
||||
@@ -18,6 +20,10 @@ export const agentAvatarOptions: AgentAvatarOption[] = Array.from({ length: 16 }
|
||||
};
|
||||
});
|
||||
|
||||
export function getAgentAvatarSrc(avatarId: string | null | undefined): string {
|
||||
export function getAgentAvatarSrc(
|
||||
avatarId: string | null | undefined,
|
||||
avatarDataUrl?: string | null,
|
||||
): string {
|
||||
if (isProjectAgentAvatarDataUrl(avatarDataUrl)) return avatarDataUrl;
|
||||
return agentAvatarOptions.find((option) => option.id === avatarId)?.src ?? agentAvatarOptions[0]!.src;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user