mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 08:26:22 +02:00
- Updated `next.config.ts` to scope Turbopack to the app's directory. - Modified `package.json` and `package-lock.json` to include new dependencies for Tiptap and markdown processing. - Removed deprecated chat API and added new agent and config routes for file management. - Introduced `JsonEditor` and `MarkdownViewer` components for improved content editing and display. - Enhanced `TiptapMarkdownEditor` with additional toolbar options and markdown parsing capabilities. - Updated layout and page components to integrate new editors and improve user experience.
80 lines
1.7 KiB
TypeScript
80 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import { Separator } from "@/components/ui/separator";
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from "@/components/ui/tooltip";
|
|
import { cn } from "@/lib/utils";
|
|
import { BookmarkIcon, type LucideProps } from "lucide-react";
|
|
import type { ComponentProps, HTMLAttributes } from "react";
|
|
|
|
export type CheckpointProps = HTMLAttributes<HTMLDivElement>;
|
|
|
|
export const Checkpoint = ({
|
|
className,
|
|
children,
|
|
...props
|
|
}: CheckpointProps) => (
|
|
<div
|
|
className={cn("flex items-center gap-0.5 text-muted-foreground overflow-hidden", className)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
<Separator />
|
|
</div>
|
|
);
|
|
|
|
export type CheckpointIconProps = LucideProps;
|
|
|
|
export const CheckpointIcon = ({
|
|
className,
|
|
children,
|
|
...props
|
|
}: CheckpointIconProps) =>
|
|
children ?? (
|
|
<BookmarkIcon className={cn("size-4 shrink-0", className)} {...props} />
|
|
);
|
|
|
|
export type CheckpointTriggerProps = ComponentProps<typeof Button> & {
|
|
tooltip?: string;
|
|
};
|
|
|
|
export const CheckpointTrigger = ({
|
|
children,
|
|
className,
|
|
variant = "ghost",
|
|
size = "sm",
|
|
tooltip,
|
|
...props
|
|
}: CheckpointTriggerProps) =>
|
|
tooltip ? (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Button
|
|
className={cn(className)}
|
|
size={size}
|
|
type="button"
|
|
variant={variant}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent align="start" side="bottom">
|
|
{tooltip}
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
) : (
|
|
<Button
|
|
className={cn(className)}
|
|
size={size}
|
|
type="button"
|
|
variant={variant}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</Button>
|
|
);
|