import { ActionIcon, Alert, Button, Divider, Group, Stack, Table, Text, TextInput, Title, } from "@mantine/core"; export interface RootEntry { name: string; uri: string; } export interface RootsTableProps { roots: RootEntry[]; newRootName: string; newRootPath: string; onRemoveRoot: (uri: string) => void; onNewRootNameChange: (name: string) => void; onNewRootPathChange: (path: string) => void; onAddRoot: () => void; onBrowse: () => void; } const HintText = Text.withProps({ size: "sm", c: "dimmed", }); const RemoveIcon = ActionIcon.withProps({ color: "red", variant: "subtle", }); const AddRootButton = Button.withProps({ variant: "light", fullWidth: true, }); export function RootsTable({ roots, newRootName, newRootPath, onRemoveRoot, onNewRootNameChange, onNewRootPathChange, onAddRoot, onBrowse, }: RootsTableProps) { return ( Roots Configuration Filesystem roots exposed to the connected server: {roots.length > 0 && ( Name URI Actions {roots.map((root) => ( {root.name} {root.uri} onRemoveRoot(root.uri)}> X ))}
)} + Add Root Add New Root: onNewRootNameChange(e.currentTarget.value)} /> onNewRootPathChange(e.currentTarget.value)} /> Roots give the server access to these directories. Only add directories you trust the server to access.
); }