2024-12-10 13:07:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Switch } from '~/components/ui/Switch';
|
2024-12-15 11:17:16 +00:00
|
|
|
import { PromptLibrary } from '~/lib/common/prompt-library';
|
2024-12-10 13:07:05 +00:00
|
|
|
import { useSettings } from '~/lib/hooks/useSettings';
|
|
|
|
|
|
|
|
export default function FeaturesTab() {
|
2024-12-15 16:45:17 +00:00
|
|
|
const { debug, enableDebugMode, isLocalModel, enableLocalModels, enableEventLogs, promptId, setPromptId } =
|
2024-12-15 11:17:16 +00:00
|
|
|
useSettings();
|
2024-12-15 00:43:43 +00:00
|
|
|
const handleToggle = (enabled: boolean) => {
|
|
|
|
enableDebugMode(enabled);
|
|
|
|
enableEventLogs(enabled);
|
|
|
|
};
|
|
|
|
|
2024-12-10 13:07:05 +00:00
|
|
|
return (
|
|
|
|
<div className="p-4 bg-bolt-elements-bg-depth-2 border border-bolt-elements-borderColor rounded-lg mb-4">
|
|
|
|
<div className="mb-6">
|
|
|
|
<h3 className="text-lg font-medium text-bolt-elements-textPrimary mb-4">Optional Features</h3>
|
|
|
|
<div className="flex items-center justify-between mb-2">
|
2024-12-15 00:43:43 +00:00
|
|
|
<span className="text-bolt-elements-textPrimary">Debug Features</span>
|
|
|
|
<Switch className="ml-auto" checked={debug} onCheckedChange={handleToggle} />
|
2024-12-13 00:11:35 +00:00
|
|
|
</div>
|
2024-12-10 13:07:05 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="mb-6 border-t border-bolt-elements-borderColor pt-4">
|
|
|
|
<h3 className="text-lg font-medium text-bolt-elements-textPrimary mb-4">Experimental Features</h3>
|
|
|
|
<p className="text-sm text-bolt-elements-textSecondary mb-4">
|
|
|
|
Disclaimer: Experimental features may be unstable and are subject to change.
|
|
|
|
</p>
|
2024-12-15 15:31:52 +00:00
|
|
|
|
2024-12-10 13:07:05 +00:00
|
|
|
<div className="flex items-center justify-between mb-2">
|
2024-12-15 00:40:37 +00:00
|
|
|
<span className="text-bolt-elements-textPrimary">Experimental Providers</span>
|
2024-12-10 13:07:05 +00:00
|
|
|
<Switch className="ml-auto" checked={isLocalModel} onCheckedChange={enableLocalModels} />
|
|
|
|
</div>
|
2024-12-15 11:17:16 +00:00
|
|
|
<div className="flex items-start justify-between pt-4 mb-2 gap-2">
|
|
|
|
<div className="flex-1 max-w-[200px]">
|
|
|
|
<span className="text-bolt-elements-textPrimary">Prompt Library</span>
|
|
|
|
<p className="text-sm text-bolt-elements-textSecondary mb-4">
|
|
|
|
Choose a prompt from the library to use as the system prompt.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<select
|
|
|
|
value={promptId}
|
|
|
|
onChange={(e) => setPromptId(e.target.value)}
|
|
|
|
className="flex-1 p-2 ml-auto rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus transition-all text-sm min-w-[100px]"
|
|
|
|
>
|
|
|
|
{PromptLibrary.getList().map((x) => (
|
|
|
|
<option value={x.id}>{x.label}</option>
|
|
|
|
))}
|
|
|
|
</select>
|
|
|
|
</div>
|
2024-12-10 13:07:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|