interface HandleViewportSwitchOptions { currentIsMobile: boolean nextIsMobile: boolean hasMountedEditor: boolean remountEditor: () => void } export function handlePostBodyMarkdownEditorViewportSwitch(options: HandleViewportSwitchOptions): boolean { if (options.currentIsMobile === options.nextIsMobile) { return false } if (!options.hasMountedEditor) { return true } options.remountEditor() return true }