import { IconButton, Tooltip } from '@affine/component'; import { contentLayoutAtom } from '@toeverything/plugin-infra/atom'; import { useSetAtom } from 'jotai'; import type { ReactElement } from 'react'; import { useCallback } from 'react'; export const HeaderItem = (): ReactElement => { const setLayout = useSetAtom(contentLayoutAtom); return ( setLayout(layout => { if (layout === 'editor') { return { direction: 'horizontal', first: 'editor', second: 'copilot', splitPercentage: 70, }; } else { return 'editor'; } }), [setLayout] )} > ); };