import { Main } from "~/components/Main"; import type { LinksFunction } from "@remix-run/node"; import { json } from "@remix-run/node"; import { mostRecentArticles } from "~/modules/articles"; import styles from "~/styles/front.css"; import { useTranslation } from "~/hooks/useTranslation"; import type { SendouRouteHandle } from "~/utils/remix"; import { articlePage, ARTICLES_MAIN_PAGE, navIconUrl } from "~/utils/urls"; import { Link, useLoaderData } from "@remix-run/react"; const MAX_ARTICLES_COUNT = 100; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: styles }]; }; export const handle: SendouRouteHandle = { breadcrumb: () => ({ imgPath: navIconUrl("articles"), href: ARTICLES_MAIN_PAGE, type: "IMAGE", }), }; export const loader = async () => { return json({ articles: await mostRecentArticles(MAX_ARTICLES_COUNT), }); }; export default function ArticlesMainPage() { const { t } = useTranslation(["common"]); const data = useLoaderData(); return (
); }