CreateComponentFamilyState -> createComponentFamilyStateV2 (#11546)
Refacto of createComponentFamilyState --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectedCommandState';
|
||||
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
||||
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
@ -9,10 +11,12 @@ export const CommandMenuDefaultSelectionEffect = ({
|
||||
}: {
|
||||
selectableItemIds: string[];
|
||||
}) => {
|
||||
const { setSelectedItemId, selectedItemIdState } =
|
||||
useSelectableList('command-menu-list');
|
||||
const { setSelectedItemId } = useSelectableList('command-menu-list');
|
||||
|
||||
const selectedItemId = useRecoilValue(selectedItemIdState);
|
||||
const selectedItemId = useRecoilComponentValueV2(
|
||||
selectedItemIdComponentState,
|
||||
'command-menu-list',
|
||||
);
|
||||
|
||||
const hasUserSelectedCommand = useRecoilValue(hasUserSelectedCommandState);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user