Elffuss BraidHub

kikocis/continue public

bc3425f09bf8 · 928 BRawPermalink
1import { ComputerDesktopIcon, SparklesIcon } from "@heroicons/react/24/outline";
2import { ProfileDescription } from "core/config/ProfileLifecycleManager";
3import { isLocalProfile } from "../../util";
4
5export interface AssistantIconProps {
6 assistant: ProfileDescription;
7 size?: number;
8}
9
10export function AssistantIcon({ assistant, size }: AssistantIconProps) {
11 const sizeTw = size ?? 4;
12 if (isLocalProfile(assistant)) {
13 return (
14 <div
15 className={`h-${sizeTw} w-${sizeTw} bg-lightgray flex items-center justify-center rounded-full`}
16 >
17 <ComputerDesktopIcon
18 className={`h-${sizeTw - 1} w-${sizeTw - 1} font-bold text-black`}
19 />
20 </div>
21 );
22 } else if (assistant.iconUrl) {
23 return (
24 <img
25 src={assistant.iconUrl}
26 className={`h-${sizeTw} w-${sizeTw} rounded-full`}
27 alt=""
28 />
29 );
30 } else {
31 return <SparklesIcon />;
32 }
33}