fix: eslint errors
This commit is contained in:
parent
1cfdda4e19
commit
44a95cbf1c
6 changed files with 60 additions and 36 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { GetServerSideProps } from "next";
|
||||
import { type GetServerSideProps } from "next";
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
|
||||
|
|
@ -10,6 +10,18 @@ import { Training } from "lib/content/training";
|
|||
import { Layout } from "~/components/Layout";
|
||||
import { Button } from "~/components/Button";
|
||||
|
||||
type Trainings = [
|
||||
{
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
days: number;
|
||||
draft: boolean;
|
||||
priceOpen: number;
|
||||
priceCorporate: number;
|
||||
}
|
||||
];
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const session = await getServerAuthSession(ctx);
|
||||
|
||||
|
|
@ -26,10 +38,11 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
|||
priceCorporate: true,
|
||||
}
|
||||
});
|
||||
|
||||
return { props: { trainings: trainings, session } };
|
||||
}
|
||||
|
||||
function Table({trainings}: { trainings: Training[] }) {
|
||||
function Table({trainings}: { trainings: Trainings }) {
|
||||
return (
|
||||
<div className="px-4 sm:px-6 lg:px-8">
|
||||
<div className="sm:flex sm:items-center">
|
||||
|
|
@ -105,7 +118,7 @@ function Table({trainings}: { trainings: Training[] }) {
|
|||
)
|
||||
}
|
||||
|
||||
export default function Training({ trainings }: { trainings: Training[] }) {
|
||||
export default function Training({ trainings }: { trainings: Trainings }) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
|
|
|||
Reference in a new issue