The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { SidePanelPages } from 'twenty-shared/types';
import { IconSearch } from 'twenty-ui/icon';
import { v4 } from 'uuid';
import { useLingui } from '@lingui/react/macro';
export const useOpenRecordsSearchPageInSidePanel = () => {
const { t } = useLingui();
const { navigateSidePanelMenu } = useSidePanelMenu();
const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
const openRecordsSearchPage = () => {
navigateSidePanelMenu({
page: SidePanelPages.SearchRecords,
pageTitle: t`Search`,
pageIcon: IconSearch,
pageId: v4(),
resetNavigationStack: isSidePanelOpened,
});
};
return {
openRecordsSearchPage,
};
};