feat: add SelectionCheckbox component for improved checkbox behavior in DocumentList and FAQList

This commit is contained in:
mlogclub
2026-06-20 11:42:57 +08:00
parent 77a96445c7
commit 30ebfcface
4 changed files with 32 additions and 7 deletions
@@ -0,0 +1,26 @@
"use client";
import type { ComponentProps } from "react";
import { Checkbox } from "@/components/ui/checkbox";
import { cn } from "@/lib/utils";
type SelectionCheckboxProps = ComponentProps<typeof Checkbox> & {
wrapperClassName?: string;
};
export function SelectionCheckbox({
className,
wrapperClassName,
...props
}: SelectionCheckboxProps) {
return (
<span
className={cn("inline-flex shrink-0", wrapperClassName)}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => event.stopPropagation()}
>
<Checkbox className={className} {...props} />
</span>
);
}