Merge branch 'master' into dark-mode

This commit is contained in:
shatfield4 2024-10-15 12:10:48 -07:00
commit 79898610cc

View File

@ -8,8 +8,10 @@ import Admin from "@/models/admin";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import paths from "@/utils/paths"; import paths from "@/utils/paths";
import useUser from "@/hooks/useUser";
export default function WorkspaceAgentConfiguration({ workspace }) { export default function WorkspaceAgentConfiguration({ workspace }) {
const { user } = useUser();
const [settings, setSettings] = useState({}); const [settings, setSettings] = useState({});
const [hasChanges, setHasChanges] = useState(false); const [hasChanges, setHasChanges] = useState(false);
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);
@ -84,21 +86,26 @@ export default function WorkspaceAgentConfiguration({ workspace }) {
workspace={workspace} workspace={workspace}
setHasChanges={setHasChanges} setHasChanges={setHasChanges}
/> />
{!hasChanges && ( {(!user || user?.role === "admin") && (
<div className="flex flex-col gap-y-4"> <>
<a {!hasChanges && (
className="w-fit transition-all duration-300 border border-slate-200 px-5 py-2.5 rounded-lg text-white text-sm items-center flex gap-x-2 hover:bg-slate-200 hover:text-slate-800 focus:ring-gray-800" <div className="flex flex-col gap-y-4">
href={paths.settings.agentSkills()} <a
> className="w-fit transition-all duration-300 border border-slate-200 px-5 py-2.5 rounded-lg text-white text-sm items-center flex gap-x-2 hover:bg-slate-200 hover:text-slate-800 focus:ring-gray-800"
Configure Agent Skills href={paths.settings.agentSkills()}
</a> >
<p className="text-white text-opacity-60 text-xs font-medium"> Configure Agent Skills
Customize and enhance the default agent's capabilities by enabling </a>
or disabling specific skills. These settings will be applied <p className="text-white text-opacity-60 text-xs font-medium">
across all workspaces. Customize and enhance the default agent's capabilities by
</p> enabling or disabling specific skills. These settings will be
</div> applied across all workspaces.
</p>
</div>
)}
</>
)} )}
{hasChanges && ( {hasChanges && (
<button <button
type="submit" type="submit"