import { type JSX, Show, splitProps } from 'solid-js'; import { cn } from '../utils/cn'; import { Button } from '../ui/button'; import { Tooltip } from '../ui/tooltip'; import { Separator } from '../ui/separator'; export interface CheckpointProps extends JSX.HTMLAttributes {} export function Checkpoint(props: CheckpointProps) { const [local, rest] = splitProps(props, ['class', 'children']); return (
{local.children}
); } export interface CheckpointIconProps { class?: string; children?: JSX.Element; } export function CheckpointIcon(props: CheckpointIconProps) { return ( ); } export interface CheckpointTriggerProps { tooltip?: string; /** Accessible name for the button — required when it has no visible text (icon-only). */ 'aria-label'?: string; onClick?: () => void; children?: JSX.Element; class?: string; variant?: 'ghost' | 'default' | 'outline'; size?: 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm'; } export function CheckpointTrigger(props: CheckpointTriggerProps) { const variant = () => props.variant ?? 'ghost'; const size = () => props.size ?? 'sm'; // A factory (not a single shared node): the Show fallback and the Tooltip // child each need their OWN element instance, otherwise Solid reuses one DOM // node across both branches and throws HierarchyRequestError when the tooltip // branch mounts it. const renderButton = () => ( ); return ( {renderButton()} ); }