import { BoxIcon, ChevronDownIcon, FolderIcon, LaptopIcon, LockIcon, MessageSquareIcon, PlusIcon, ServerIcon, UsersIcon, } from "lucide-react"; import { useState, type ReactNode } from "react"; import { Button } from "../../../ui/button"; import { COMPOSER_MENU_PANEL_CLASS } from "../../../ui/composer-menu"; import { DropdownMenu, DropdownMenuCheck, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "../../../ui/dropdown-menu"; import type { Channel } from "../../types"; import { ProjectGlyph } from "../rail/project-glyph"; import type { RunsOnChoices } from "./new-session-settings-menu"; /* * The strip above a new chat's message: where the chat is filed (its project), * where it runs and who can see it. Each chip shows only when there is * something to choose, so the composer's footer stays an action row. */ /** A new chat's setup choice shown as a chip in the strip above the message. */ export type SessionSetupSetting = { /** The setting's name, for the chip's accessible name and tooltip. */ label: string; /** The current value, shown on the chip. */ summary: string; icon: ReactNode; disabled: boolean; /** The menu body; `close` closes the chip's menu after a final choice. */ renderMenu: (close: () => void) => ReactNode; }; // Setup selections sit above the prompt so the footer remains an action row: // where the new chat is filed, where it runs and who can see it, each shown // only when there is something to choose. Tools, repositories and the other // per-chat settings live under “+” at every width. export function SessionSetupStrip({ disabled, project, runsOn, visibility, }: { disabled: boolean; project: { channels: Channel[]; selectedChannelId: string | null; onChange: (channelId: string | null) => void; onCreate: () => void; } | null; runsOn: SessionSetupSetting | null; visibility: SessionSetupSetting | null; }) { return (