mirror of
https://github.com/ershisan99/vacancies-trends-front.git
synced 2025-12-17 20:59:27 +00:00
initial commit
This commit is contained in:
@@ -1,41 +1,18 @@
|
||||
import type { MetaFunction } from "@remix-run/node";
|
||||
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!" },
|
||||
];
|
||||
};
|
||||
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() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
|
||||
<h1>Welcome to Remix</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://remix.run/start/quickstart"
|
||||
rel="noreferrer"
|
||||
>
|
||||
5m Quick Start
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://remix.run/start/tutorial"
|
||||
rel="noreferrer"
|
||||
>
|
||||
30m Tutorial
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
|
||||
Remix Docs
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
const { vacancies } = useLoaderData<typeof loader>()
|
||||
return <VacanciesChart data={vacancies} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user