mirror of
https://github.com/ershisan99/vacancies-trends-front.git
synced 2025-12-16 12:34:06 +00:00
19 lines
650 B
TypeScript
19 lines
650 B
TypeScript
import { json, MetaFunction } from '@remix-run/node'
|
|
import { vacanciesService } from '~/services/vacancies/vacancies.service'
|
|
import { useLoaderData } from '@remix-run/react'
|
|
import { VacanciesChart } from '~/components/vacancies-chart'
|
|
|
|
export const meta: MetaFunction = () => {
|
|
return [{ title: 'New Remix App' }, { name: 'description', content: 'Welcome to Remix!' }]
|
|
}
|
|
|
|
export const loader = async () => {
|
|
const vacancies = await vacanciesService.getAggregateByCreatedAt()
|
|
return json({ vacancies })
|
|
}
|
|
|
|
export default function Index() {
|
|
const { vacancies } = useLoaderData<typeof loader>()
|
|
return <VacanciesChart data={vacancies} />
|
|
}
|