2023-02-17 09:21:02 +00:00
|
|
|
import { PageLayout } from '../components/_shared/PageLayout'
|
|
|
|
import { AllAuthorsView } from '../components/Views/AllAuthors'
|
|
|
|
import type { PageProps } from './types'
|
2022-11-15 09:38:12 +00:00
|
|
|
import { createSignal, onMount, Show } from 'solid-js'
|
2023-02-17 09:21:02 +00:00
|
|
|
import { loadAllAuthors } from '../stores/zine/authors'
|
|
|
|
import { Loading } from '../components/_shared/Loading'
|
2023-11-14 10:45:44 +00:00
|
|
|
|
2023-05-05 20:05:50 +00:00
|
|
|
import { useLocalize } from '../context/localize'
|
2022-09-22 09:37:49 +00:00
|
|
|
|
|
|
|
export const AllAuthorsPage = (props: PageProps) => {
|
2022-11-15 09:38:12 +00:00
|
|
|
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allAuthors))
|
|
|
|
|
2023-05-05 20:05:50 +00:00
|
|
|
const { t } = useLocalize()
|
|
|
|
|
2022-11-15 09:38:12 +00:00
|
|
|
onMount(async () => {
|
|
|
|
if (isLoaded()) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
await loadAllAuthors()
|
|
|
|
setIsLoaded(true)
|
|
|
|
})
|
|
|
|
|
2022-09-22 09:37:49 +00:00
|
|
|
return (
|
2023-11-14 10:45:44 +00:00
|
|
|
<PageLayout title={t('Authors')}>
|
2022-11-15 09:38:12 +00:00
|
|
|
<Show when={isLoaded()} fallback={<Loading />}>
|
2022-10-05 15:11:14 +00:00
|
|
|
<AllAuthorsView authors={props.allAuthors} />
|
2022-11-15 09:38:12 +00:00
|
|
|
</Show>
|
2023-02-17 09:21:02 +00:00
|
|
|
</PageLayout>
|
2022-09-22 09:37:49 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-02-17 09:21:02 +00:00
|
|
|
export const Page = AllAuthorsPage
|