From adaa8b6a7b0470eda5ce8114be9c0710bc09bf41 Mon Sep 17 00:00:00 2001 From: sherifButt <90522472+sherifButt@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:00:46 +0000 Subject: [PATCH] - added Meta Response Inputs toggle - removed badge extra colors --- .../components/Generic/Badges/Badge/index.jsx | 7 -- .../Generic/Blocks/CheckBoxBlock/index.jsx | 18 ++++- .../Generic/Blocks/ToggleBlock/index.jsx | 15 ++--- .../MetaResponse/EnableFeatures/index.jsx | 2 + .../EnableSystemPrompt/index.jsx | 32 +++++++-- .../MetaResponse/InputsFeature/index.jsx | 2 +- .../WorkspaceSettings/MetaResponse/index.jsx | 67 ++++++++++++++++++- 7 files changed, 117 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/Generic/Badges/Badge/index.jsx b/frontend/src/components/Generic/Badges/Badge/index.jsx index 53c62049..0be7d849 100644 --- a/frontend/src/components/Generic/Badges/Badge/index.jsx +++ b/frontend/src/components/Generic/Badges/Badge/index.jsx @@ -4,13 +4,6 @@ import React from "react"; const colorMapping = (bg) => { const mappings = { "emerald-600": { text: "text-emerald-100", icon: "text-emerald-200 group-hover:text-emerald-50" }, - "red-600": { text: "text-red-100", icon: "text-red-200 group-hover:text-red-50" }, - "blue-600": { text: "text-blue-100", icon: "text-blue-200 group-hover:text-blue-50" }, - "yellow-600": { text: "text-yellow-100", icon: "text-yellow-200 group-hover:text-yellow-50" }, - "gray-600": { text: "text-gray-100", icon: "text-gray-200 group-hover:text-gray-50" }, - "purple-600": { text: "text-purple-100", icon: "text-purple-200 group-hover:text-purple-50" }, - "pink-600": { text: "text-pink-100", icon: "text-pink-200 group-hover:text-pink-50" }, - "indigo-600": { text: "text-indigo-100", icon: "text-indigo-200 group-hover:text-indigo-50" }, }; return mappings[bg] || { text: "text-gray-100", icon: "text-gray-200" }; diff --git a/frontend/src/components/Generic/Blocks/CheckBoxBlock/index.jsx b/frontend/src/components/Generic/Blocks/CheckBoxBlock/index.jsx index de87cb93..d6f34a46 100644 --- a/frontend/src/components/Generic/Blocks/CheckBoxBlock/index.jsx +++ b/frontend/src/components/Generic/Blocks/CheckBoxBlock/index.jsx @@ -2,6 +2,23 @@ import React from "react"; import Badge from "@/components/Generic/Badges/Badge"; import CheckBox from "../../Inputs/CheckBox"; +/** + * @description A block that contains a checkbox and its label and description + * @param {boolean} initialChecked - initial state of the checkbox + * @param {string} label - label for the checkbox + * @param {function} onToggle - function to call when the checkbox is toggled + * @param {string} description - description of the checkbox + * @param {string} name - name of the checkbox + * @param {boolean} badge - whether to show a badge + * @param {string} badgeLabel - label for the badge + * @param {boolean} badgeAnimated - whether the badge should be animated + * @param {string} badgeBg - background color for the badge + * @param {boolean} border - whether to show a border + * @param {React.Component} Icon - icon to show next to the checkbox + * @param {string} contentLocation - location of the content + * @param {boolean} disabled - whether the checkbox is disabled + * @param {boolean} inline - whether the checkbox should be inline + */ export default function CheckBoxBlock({ initialChecked, label, @@ -75,7 +92,6 @@ export default function CheckBoxBlock({ {description}
- ); diff --git a/frontend/src/components/Generic/Blocks/ToggleBlock/index.jsx b/frontend/src/components/Generic/Blocks/ToggleBlock/index.jsx index 967a72a3..5584eda0 100644 --- a/frontend/src/components/Generic/Blocks/ToggleBlock/index.jsx +++ b/frontend/src/components/Generic/Blocks/ToggleBlock/index.jsx @@ -14,27 +14,24 @@ export default function ToggleBlock({ badgeAnimated, badgeBg, border, + bg, Icon, contentLocation, disabled, inline = false, }) { const borderStyle = border ? "border border-gray-600 rounded-2xl p-4" : ""; - const contentPosition = { - middle: "middle", - top: "top", - bottom: "bottom", - }[contentLocation]; + const backgroundStyle = bg ? "bg-black/10" : ""; return ( -