plane/web/components/core/multiple-select/select-group.tsx
Aaryan Khandelwal 98ebe88c86
[WEB-1501] dev: multiple select core components (#4667)
* dev: multiple select core components

* chore: added export statement
2024-05-31 17:37:24 +05:30

23 lines
640 B
TypeScript

import { observer } from "mobx-react";
// hooks
import { TSelectionHelper, useMultipleSelect } from "@/hooks/use-multiple-select";
type Props = {
children: (helpers: TSelectionHelper) => 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 = useMultipleSelect({
containerRef,
entities,
});
return <>{children(helpers)}</>;
});
MultipleSelectGroup.displayName = "MultipleSelectGroup";