({
pageId,
storyId,
viewId,
}: {
pageId?: string | null;
storyId?: string | null;
viewId?: string | null;
})
| 211 | }; |
| 212 | |
| 213 | const getPageSelection = ({ |
| 214 | pageId, |
| 215 | storyId, |
| 216 | viewId, |
| 217 | }: { |
| 218 | pageId?: string | null; |
| 219 | storyId?: string | null; |
| 220 | viewId?: string | null; |
| 221 | }): PageSelection => { |
| 222 | const storySelection = getPageSelectionForStory(storyId); |
| 223 | |
| 224 | if (storySelection) { |
| 225 | return storySelection; |
| 226 | } |
| 227 | |
| 228 | const mode = |
| 229 | allShowcaseModes.find((currentMode) => currentMode.id === viewId) ?? |
| 230 | defaultMode; |
| 231 | const page = |
| 232 | mode.pages.find((currentPage) => currentPage.id === pageId) ?? |
| 233 | mode.pages[0]; |
| 234 | |
| 235 | return { mode, page }; |
| 236 | }; |
| 237 | |
| 238 | const getInitialPageSelection = () => { |
| 239 | const params = getInitialSearchParams(); |
no test coverage detected