mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
1c849103f9
* chore: added disabled prop to mutliple select group hoc * style: fix empty space
25 lines
694 B
TypeScript
25 lines
694 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>;
|
|
disabled?: boolean;
|
|
entities: Record<string, string[]>; // { groupID: entityIds[] }
|
|
};
|
|
|
|
export const MultipleSelectGroup: React.FC<Props> = observer((props) => {
|
|
const { children, containerRef, disabled = false, entities } = props;
|
|
|
|
const helpers = useMultipleSelect({
|
|
containerRef,
|
|
disabled,
|
|
entities,
|
|
});
|
|
|
|
return <>{children(helpers)}</>;
|
|
});
|
|
|
|
MultipleSelectGroup.displayName = "MultipleSelectGroup";
|