summaryrefslogtreecommitdiffhomepage
path: root/packages/storybook/.storybook/mocks/solid-router.tsx
blob: c1bda30f4bd8c9901149a17ab861cda4cd2a7e4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { ParentProps } from "solid-js"

export function useParams() {
  return {
    dir: "c3Rvcnk=",
    id: "story-session",
  }
}

export function useNavigate() {
  return () => undefined
}

export function useLocation() {
  return {
    pathname: "/story/session/story-session",
    search: "",
    hash: "",
  }
}

export function MemoryRouter(props: ParentProps) {
  return props.children
}

export function Route(props: ParentProps) {
  return props.children
}