Build message threads (#3593)
* Adding message thread component * Add state and mocks * Rename components and use local state for messages --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { MockedThread } from '@/activities/emails/mocks/mockedEmailThreads';
|
||||
import { useOpenEmailThreadRightDrawer } from '@/activities/emails/right-drawer/hooks/useOpenEmailThreadRightDrawer';
|
||||
import { viewableEmailThreadState } from '@/activities/emails/state/viewableEmailThreadState';
|
||||
|
||||
export const useEmailThread = () => {
|
||||
const [, setViewableEmailThread] = useRecoilState(viewableEmailThreadState);
|
||||
|
||||
const openEmailThredRightDrawer = useOpenEmailThreadRightDrawer();
|
||||
|
||||
const openEmailThread = (thread: MockedThread) => {
|
||||
openEmailThredRightDrawer();
|
||||
|
||||
setViewableEmailThread(thread);
|
||||
};
|
||||
|
||||
return {
|
||||
openEmailThread,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user