webapp/src/pages/allAuthors.page.tsx
Ilya Y 4e931a39c5
Feature/all authors order (#410)
Load Authors by btn click
---------

Co-authored-by: Untone <anton.rewin@gmail.com>
2024-02-22 10:29:52 +03:00

32 lines
805 B
TypeScript

import type { PageProps } from './types'
import { createEffect, createSignal, onMount } from 'solid-js'
import { AllAuthors } from '../components/Views/AllAuthors/'
import { PageLayout } from '../components/_shared/PageLayout'
import { useLocalize } from '../context/localize'
import { loadAllAuthors } from '../stores/zine/authors'
export const AllAuthorsPage = (props: PageProps) => {
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allAuthors))
const { t } = useLocalize()
onMount(async () => {
if (isLoaded()) {
return
}
await loadAllAuthors()
setIsLoaded(true)
})
return (
<PageLayout title={t('Authors')}>
<AllAuthors isLoaded={isLoaded()} authors={props.allAuthors} />
</PageLayout>
)
}
export const Page = AllAuthorsPage