mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
21 lines
656 B
TypeScript
21 lines
656 B
TypeScript
import { observer } from "mobx-react";
|
|
// hooks
|
|
import { TSelectionHelper, TSelectionSnapshot, useMultipleSelect } from "@/hooks/use-multiple-select";
|
|
|
|
type Props = {
|
|
children: (helpers: TSelectionHelper, snapshot: TSelectionSnapshot) => React.ReactNode;
|
|
containerRef: React.MutableRefObject<HTMLElement | null>;
|
|
entities: Record<string, string[]>; // { groupID: entityIds[] }
|
|
};
|
|
|
|
export const MultipleSelectGroup: React.FC<Props> = observer((props) => {
|
|
const { children, containerRef, entities } = props;
|
|
|
|
const { helpers, snapshot } = useMultipleSelect({
|
|
containerRef,
|
|
entities,
|
|
});
|
|
|
|
return <>{children(helpers, snapshot)}</>;
|
|
});
|