(props: { path: string; actions?: JSX.Element; children: JSX.Element })
| 1388 | } |
| 1389 | |
| 1390 | function ToolFileAccordion(props: { path: string; actions?: JSX.Element; children: JSX.Element }) { |
| 1391 | const value = createMemo(() => props.path || "tool-file") |
| 1392 | |
| 1393 | return ( |
| 1394 | <Accordion |
| 1395 | multiple |
| 1396 | data-scope="apply-patch" |
| 1397 | style={{ "--sticky-accordion-offset": "calc(32px + var(--tool-content-gap))" }} |
| 1398 | defaultValue={[value()]} |
| 1399 | > |
| 1400 | <Accordion.Item value={value()}> |
| 1401 | <StickyAccordionHeader> |
| 1402 | <Accordion.Trigger> |
| 1403 | <div data-slot="apply-patch-trigger-content"> |
| 1404 | <div data-slot="apply-patch-file-info"> |
| 1405 | <FileIcon node={{ path: props.path, type: "file" }} /> |
| 1406 | <div data-slot="apply-patch-file-name-container"> |
| 1407 | <Show when={props.path.includes("/")}> |
| 1408 | <span data-slot="apply-patch-directory">{`\u202A${getDirectory(props.path)}\u202C`}</span> |
| 1409 | </Show> |
| 1410 | <span data-slot="apply-patch-filename">{getFilename(props.path)}</span> |
| 1411 | </div> |
| 1412 | </div> |
| 1413 | <div data-slot="apply-patch-trigger-actions"> |
| 1414 | {props.actions} |
| 1415 | <Icon name="chevron-grabber-vertical" size="small" /> |
| 1416 | </div> |
| 1417 | </div> |
| 1418 | </Accordion.Trigger> |
| 1419 | </StickyAccordionHeader> |
| 1420 | <Accordion.Content>{props.children}</Accordion.Content> |
| 1421 | </Accordion.Item> |
| 1422 | </Accordion> |
| 1423 | ) |
| 1424 | } |
| 1425 | |
| 1426 | PART_MAPPING["tool"] = function ToolPartDisplay(props) { |
| 1427 | const data = useData() |
nothing calls this directly
no test coverage detected