import React from "react"; import { FormControl, FormDescription, FormField, FormItem, FormLabel, } from "@/components/ui/form.tsx"; import { Switch } from "@/components/ui/switch.tsx"; import { Input } from "@/components/ui/input.tsx"; import { Button } from "@/components/ui/button.tsx"; import { PasswordInput } from "@/components/ui/password-input.tsx"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select.tsx"; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion.tsx"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover.tsx"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, } from "@/components/ui/command.tsx"; import { Slider } from "@/components/ui/slider.tsx"; import { Check, ChevronsUpDown, Plus, X } from "lucide-react"; import { cn } from "@/lib/utils.ts"; import type { HostTerminalTabProps } from "./shared/tab-types"; export function HostTerminalTab({ control, watch, setValue, snippets, t, }: HostTerminalTabProps) { return ( {t("hosts.appearance")} ( {t("hosts.letterSpacingValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.adjustLetterSpacing")} )} /> ( {t("hosts.lineHeightValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.adjustLineHeight")} )} /> ( {t("hosts.terminalTheme")} {t("hosts.chooseTerminalTheme")} )} /> ( {t("hosts.terminalFont")} {t("hosts.chooseTerminalFont")} )} /> ( {t("hosts.fontSizeValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.adjustFontSize")} )} /> ( {t("hosts.cursorStyle")} {t("hosts.chooseCursorAppearance")} )} /> (
{t("hosts.cursorBlink")} {t("hosts.enableCursorBlink")}
)} />
{t("hosts.behavior")} ( {t("hosts.scrollbackBufferValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.scrollbackBufferDesc")} )} /> ( {t("hosts.bellStyle")} {t("hosts.bellStyleDesc")} )} /> (
{t("hosts.rightClickSelectsWord")} {t("hosts.rightClickSelectsWordDesc")}
)} /> ( {t("hosts.fastScrollModifier")} {t("hosts.fastScrollModifierDesc")} )} /> ( {t("hosts.fastScrollSensitivityValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.fastScrollSensitivityDesc")} )} /> ( {t("hosts.minimumContrastRatioValue", { value: field.value, })} field.onChange(value)} /> {t("hosts.minimumContrastRatioDesc")} )} />
{t("hosts.advanced")} (
{t("hosts.sshAgentForwarding")} {t("hosts.sshAgentForwardingDesc")}
)} /> ( {t("hosts.backspaceMode")} {t("hosts.backspaceModeDesc")} )} /> { const [open, setOpen] = React.useState(false); const selectedSnippet = snippets.find( (s) => s.id === field.value, ); return ( {t("hosts.startupSnippet")} {t("hosts.noSnippetFound")} { field.onChange(null); setOpen(false); }} > {t("hosts.snippetNone")} {snippets.map((snippet) => ( { field.onChange(snippet.id); setOpen(false); }} >
{snippet.name} {snippet.content}
))}
{t("hosts.executeSnippetOnConnect")}
); }} /> (
{t("hosts.autoMosh")} {t("hosts.autoMoshDesc")}
)} /> {watch("terminalConfig.autoMosh") && ( ( {t("hosts.moshCommand")} { field.onChange(e.target.value.trim()); field.onBlur(); }} /> {t("hosts.moshCommandDesc")} )} /> )} (
{t("hosts.sudoPasswordAutoFill")} {t("hosts.sudoPasswordAutoFillDesc")}
)} /> {watch("terminalConfig.sudoPasswordAutoFill") && ( ( {t("hosts.sudoPassword")} {t("hosts.sudoPasswordDesc")} )} /> )}
{t("hosts.environmentVariablesDesc")} {watch("terminalConfig.environmentVariables")?.map((_, index) => (
( { field.onChange(e.target.value.trim()); field.onBlur(); }} /> )} /> ( { field.onChange(e.target.value.trim()); field.onBlur(); }} /> )} />
))}
); }