mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 03:48:49 +02:00
Add properly random icons to assistant creation page (#2044)
This commit is contained in:
@@ -100,6 +100,14 @@ export function AssistantEditor({
|
|||||||
"#6FFFFF",
|
"#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();
|
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
// EE only
|
// EE only
|
||||||
@@ -207,8 +215,8 @@ export function AssistantEditor({
|
|||||||
existingPersona?.llm_model_version_override ?? null,
|
existingPersona?.llm_model_version_override ?? null,
|
||||||
starter_messages: existingPersona?.starter_messages ?? [],
|
starter_messages: existingPersona?.starter_messages ?? [],
|
||||||
enabled_tools_map: enabledToolsMap,
|
enabled_tools_map: enabledToolsMap,
|
||||||
icon_color: existingPersona?.icon_color ?? "#FF6FBF",
|
icon_color: existingPersona?.icon_color ?? defautIconColor,
|
||||||
icon_shape: existingPersona?.icon_shape ?? 123242312,
|
icon_shape: existingPersona?.icon_shape ?? defaultIconShape,
|
||||||
uploaded_image: null,
|
uploaded_image: null,
|
||||||
|
|
||||||
// search_tool_enabled: existingPersona
|
// search_tool_enabled: existingPersona
|
||||||
|
@@ -77,11 +77,9 @@ const ToggleSwitch = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function FunctionalWrapper({
|
export default function FunctionalWrapper({
|
||||||
// children,
|
|
||||||
initiallyToggled,
|
initiallyToggled,
|
||||||
content,
|
content,
|
||||||
}: {
|
}: {
|
||||||
// children: React.ReactNode;
|
|
||||||
content: (toggledSidebar: boolean, toggle: () => void) => ReactNode;
|
content: (toggledSidebar: boolean, toggle: () => void) => ReactNode;
|
||||||
initiallyToggled: boolean;
|
initiallyToggled: boolean;
|
||||||
}) {
|
}) {
|
||||||
|
Reference in New Issue
Block a user