-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into agent-skill-plugins
- Loading branch information
Showing
29 changed files
with
309 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
"Qdrant", | ||
"royalblue", | ||
"searxng", | ||
"SearchApi", | ||
"Serper", | ||
"Serply", | ||
"streamable", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,42 @@ | ||
import React, { useRef, useEffect } from "react"; | ||
import JAZZ from "@metamask/jazzicon"; | ||
import React, { memo } from "react"; | ||
import usePfp from "../../hooks/usePfp"; | ||
import UserDefaultPfp from "./user.svg"; | ||
import WorkspaceDefaultPfp from "./workspace.svg"; | ||
|
||
export default function UserIcon({ size = 36, user, role }) { | ||
const UserIcon = memo(({ role }) => { | ||
const { pfp } = usePfp(); | ||
const divRef = useRef(null); | ||
const seed = user?.uid | ||
? toPseudoRandomInteger(user.uid) | ||
: Math.floor(100000 + Math.random() * 900000); | ||
|
||
useEffect(() => { | ||
if (!divRef.current || (role === "user" && pfp)) return; | ||
|
||
const result = JAZZ(size, seed); | ||
divRef.current.appendChild(result); | ||
}, [pfp, role, seed, size]); | ||
|
||
return ( | ||
<div className="relative w-[35px] h-[35px] rounded-full flex-shrink-0 overflow-hidden"> | ||
<div ref={divRef} /> | ||
{role === "user" && pfp && ( | ||
{role === "user" && <RenderUserPfp pfp={pfp} />} | ||
{role !== "user" && ( | ||
<img | ||
src={pfp} | ||
alt="User profile picture" | ||
className="absolute top-0 left-0 w-full h-full object-cover rounded-full bg-white" | ||
src={WorkspaceDefaultPfp} | ||
alt="system profile picture" | ||
className="flex items-center justify-center rounded-full border border-white/40" | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
function RenderUserPfp({ pfp }) { | ||
if (!pfp) | ||
return ( | ||
<img | ||
src={UserDefaultPfp} | ||
alt="User profile picture" | ||
className="rounded-full border-none" | ||
/> | ||
); | ||
|
||
function toPseudoRandomInteger(uidString = "") { | ||
return uidString.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0); | ||
return ( | ||
<img | ||
src={pfp} | ||
alt="User profile picture" | ||
className="absolute top-0 left-0 w-full h-full object-cover rounded-full border-none" | ||
/> | ||
); | ||
} | ||
|
||
export default UserIcon; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.37 KB
frontend/src/pages/Admin/Agents/WebSearchSelection/icons/searchapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.