Files
twenty_crm/front/src/modules/comments/hooks/useOpenCommentRightDrawer.ts
Lucas Bordeau a2fe159c2c Feat/open comment drawer from comment chip (#187)
* wip

* Can open comment right drawer from company name cell
2023-06-02 17:51:17 +02:00

19 lines
664 B
TypeScript

import { useRecoilState } from 'recoil';
import { useOpenRightDrawer } from '../../ui/layout/right-drawer/hooks/useOpenRightDrawer';
import { CommentableEntity } from '../types/CommentableEntity';
import { commentableEntityArrayState } from '../states/commentableEntityArrayState';
export function useOpenCommentRightDrawer() {
const openRightDrawer = useOpenRightDrawer();
const [, setCommentableEntityArray] = useRecoilState(
commentableEntityArrayState,
);
return function openCommentRightDrawer(
commentableEntityArray: CommentableEntity[],
) {
setCommentableEntityArray(commentableEntityArray);
openRightDrawer('comments');
};
}