Add properly random icons to assistant creation page ()

This commit is contained in:
pablodanswer 2024-08-04 23:30:17 -07:00 committed by GitHub
parent 6d67d472cd
commit 66e4dded91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions
web/src/app
admin/assistants
chat/shared_chat_search

@ -100,6 +100,14 @@ export function AssistantEditor({
"#6FFFFF",
];
// state to persist across formik reformatting
const [defautIconColor, _setDeafultIconColor] = useState(
colorOptions[Math.floor(Math.random() * colorOptions.length)]
);
const [defaultIconShape, _setDeafultIconShape] = useState(
generateRandomIconShape().encodedGrid
);
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
// EE only
@ -207,8 +215,8 @@ export function AssistantEditor({
existingPersona?.llm_model_version_override ?? null,
starter_messages: existingPersona?.starter_messages ?? [],
enabled_tools_map: enabledToolsMap,
icon_color: existingPersona?.icon_color ?? "#FF6FBF",
icon_shape: existingPersona?.icon_shape ?? 123242312,
icon_color: existingPersona?.icon_color ?? defautIconColor,
icon_shape: existingPersona?.icon_shape ?? defaultIconShape,
uploaded_image: null,
// search_tool_enabled: existingPersona

@ -77,11 +77,9 @@ const ToggleSwitch = () => {
};
export default function FunctionalWrapper({
// children,
initiallyToggled,
content,
}: {
// children: React.ReactNode;
content: (toggledSidebar: boolean, toggle: () => void) => ReactNode;
initiallyToggled: boolean;
}) {