"use client"; import { IconSettings, IconTextWrap, IconLayoutColumns, IconLayoutRows, IconMessageForward, IconArrowsMaximize, } from "@tabler/icons-react"; import { Button } from "@kandev/ui/button"; import { Checkbox } from "@kandev/ui/checkbox"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@kandev/ui/dropdown-menu"; import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip"; import { PanelHeaderBarSplit } from "./panel-primitives"; export type ChangesTopBarProps = { autoMarkOnScroll: boolean; splitView: boolean; wordWrap: boolean; totalCommentCount: number; reviewedCount: number; totalCount: number; progressPercent: number; setWordWrap: (v: boolean) => void; handleToggleSplitView: (v: boolean) => void; handleToggleAutoMark: (v: boolean) => void; handleFixComments: () => void; }; function ChangesTopBarLeft({ autoMarkOnScroll, totalCount, reviewedCount, progressPercent, handleToggleAutoMark, }: Pick< ChangesTopBarProps, "autoMarkOnScroll" | "totalCount" | "reviewedCount" | "progressPercent" | "handleToggleAutoMark" >) { return ( <> { e.preventDefault(); handleToggleAutoMark(!autoMarkOnScroll); }} > Auto-mark reviewed on scroll {totalCount > 0 && (
{reviewedCount}/{totalCount} Reviewed
)} ); } function ChangesTopBarRight({ splitView, wordWrap, totalCommentCount, setWordWrap, handleToggleSplitView, handleFixComments, }: Pick< ChangesTopBarProps, | "splitView" | "wordWrap" | "totalCommentCount" | "setWordWrap" | "handleToggleSplitView" | "handleFixComments" >) { return ( <> Expand review Toggle word wrap {splitView ? "Unified view" : "Split view"} {totalCommentCount > 0 && ( )} ); } export function ChangesTopBar({ autoMarkOnScroll, splitView, wordWrap, totalCommentCount, reviewedCount, totalCount, progressPercent, setWordWrap, handleToggleSplitView, handleToggleAutoMark, handleFixComments, }: ChangesTopBarProps) { return ( } right={ } /> ); }