Files
tutti/packages/agent/gui/shared/AgentVerticalScrollArea.tsx
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

57 lines
1.4 KiB
TypeScript

import {
forwardRef,
type HTMLAttributes,
type ReactNode,
type JSX
} from "react";
import { CustomScrollArea } from "../app/renderer/components/ui/custom-scroll-area";
import { cn } from "../app/renderer/lib/utils";
export interface AgentVerticalScrollAreaProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
viewportClassName?: string;
scrollbarClassName?: string;
scrollbarThumbClassName?: string;
syncKey?: unknown;
}
export const AgentVerticalScrollArea = forwardRef<
HTMLDivElement,
AgentVerticalScrollAreaProps
>(function AgentVerticalScrollArea(
{
children,
className,
viewportClassName,
scrollbarClassName,
scrollbarThumbClassName,
syncKey,
...props
},
forwardedRef
): JSX.Element {
"use memo";
return (
<CustomScrollArea
ref={forwardedRef}
className={cn("agent-vertical-scroll-area min-h-0 min-w-0", className)}
viewportClassName={cn(
"min-h-0 min-w-0 overflow-x-hidden overflow-y-auto",
viewportClassName
)}
scrollbarClassName={cn(
"agent-vertical-scroll-area__scrollbar top-2 right-2 bottom-2",
scrollbarClassName
)}
scrollbarThumbClassName={cn(
"agent-vertical-scroll-area__scrollbar-thumb",
scrollbarThumbClassName
)}
syncKey={syncKey ?? children}
{...props}
>
{children}
</CustomScrollArea>
);
});