|
1 | 1 | import {useState, useEffect, useRef} from "react"; |
2 | 2 | import {useQuery, useMutation, useQueryClient} from "@tanstack/react-query"; |
3 | 3 | import {api, type GlobalSettingsResponse} from "@/api/client"; |
4 | | -import {Button, Input, SettingSidebarButton, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem} from "@/ui"; |
| 4 | +import {Button, Input, SettingSidebarButton, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Toggle} from "@/ui"; |
5 | 5 | import {useSearch, useNavigate} from "@tanstack/react-router"; |
6 | 6 | import {ChannelSettingCard, DisabledChannelCard} from "@/components/ChannelSettingCard"; |
7 | 7 | import {ProviderIcon} from "@/lib/providerIcons"; |
| 8 | +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; |
| 9 | +import {faSearch} from "@fortawesome/free-solid-svg-icons"; |
8 | 10 |
|
9 | 11 | import {parse as parseToml} from "smol-toml"; |
10 | 12 |
|
@@ -502,9 +504,7 @@ function ApiKeysSection({settings, isLoading}: GlobalSettingsSectionProps) { |
502 | 504 | <div className="flex flex-col gap-3"> |
503 | 505 | <div className="rounded-lg border border-app-line bg-app-box p-4"> |
504 | 506 | <div className="flex items-center gap-3"> |
505 | | - <div className="flex h-8 w-8 items-center justify-center rounded-lg bg-app-darkBox text-ink-faint"> |
506 | | - <span className="text-lg">🔍</span> |
507 | | - </div> |
| 507 | + <FontAwesomeIcon icon={faSearch} className="text-ink-faint" /> |
508 | 508 | <div className="flex-1"> |
509 | 509 | <div className="flex items-center gap-2"> |
510 | 510 | <span className="text-sm font-medium text-ink">Brave Search</span> |
@@ -655,20 +655,19 @@ function ServerSection({settings, isLoading}: GlobalSettingsSectionProps) { |
655 | 655 | ) : ( |
656 | 656 | <div className="flex flex-col gap-4"> |
657 | 657 | <div className="rounded-lg border border-app-line bg-app-box p-4"> |
658 | | - <label className="flex items-center gap-3"> |
659 | | - <input |
660 | | - type="checkbox" |
661 | | - checked={apiEnabled} |
662 | | - onChange={(e) => setApiEnabled(e.target.checked)} |
663 | | - className="h-4 w-4" |
664 | | - /> |
| 658 | + <div className="flex items-center justify-between"> |
665 | 659 | <div> |
666 | 660 | <span className="text-sm font-medium text-ink">Enable API Server</span> |
667 | 661 | <p className="mt-0.5 text-sm text-ink-dull"> |
668 | 662 | Disable to prevent the HTTP API from starting |
669 | 663 | </p> |
670 | 664 | </div> |
671 | | - </label> |
| 665 | + <Toggle |
| 666 | + size="sm" |
| 667 | + checked={apiEnabled} |
| 668 | + onCheckedChange={setApiEnabled} |
| 669 | + /> |
| 670 | + </div> |
672 | 671 | </div> |
673 | 672 |
|
674 | 673 | <div className="rounded-lg border border-app-line bg-app-box p-4"> |
|
0 commit comments