import * as queryString from 'query-string'; export const getCustomQueryParams = (storyName: string) => { const previewId = queryString.parse(window.location.search).previewId || null; const story = queryString.parse(window.location.search).storyName || null; const isPreview = storyName === story && previewId; return { previewId, enabled: isPreview }; };