"use client"; import { useLayoutEffect, useState } from "react"; import { IconCode } from "@tabler/icons-react"; import { CardContent, CardHeader, CardTitle } from "@kandev/ui/card"; import { Input } from "@kandev/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@kandev/ui/select"; import { SettingsSection } from "@/components/settings/settings-section"; import { SettingsCard } from "@/components/settings/settings-card"; import { useTranslation } from "react-i18next"; import { GENERAL_SETTINGS_TARGETS } from "@/lib/settings-discovery/catalog/preferences"; const AUTO_SHELL = "auto"; const CUSTOM_SHELL = "custom"; type ShellOption = { value: string; label: string }; function resolveShellSelection(preferredShell: string, shellOptions: ShellOption[]) { if (!preferredShell) { return { selection: AUTO_SHELL, customShell: "" }; } if (shellOptions.some((option) => option.value === preferredShell)) { return { selection: preferredShell, customShell: "" }; } return { selection: CUSTOM_SHELL, customShell: preferredShell }; } type ShellSelectProps = { shellSelection: string; isDirty: boolean; onSelectionChange: (value: string) => void; customShell: string; onCustomShellChange: (value: string) => void; shellLoaded: boolean; shellOptions: ShellOption[]; }; function ShellSelect({ shellSelection, isDirty, onSelectionChange, customShell, onCustomShellChange, shellLoaded, shellOptions, }: ShellSelectProps) { const { t } = useTranslation(); return ( <>
{t("settings:enterAShellPathOrCommand")}
{t("settings:newTaskSessionsWillUseThis")}