2024-01-02 22:19:14 +00:00
|
|
|
---
|
|
|
|
import Layout from '../layouts/Layout.astro'
|
|
|
|
import BaseSection from '../layouts/baseSection.astro'
|
|
|
|
import TACard from '../components/taCard.astro'
|
2024-01-04 23:43:02 +00:00
|
|
|
import type { FileData } from '../types/ta'
|
|
|
|
import type { GlobAny } from '../types/generic'
|
2024-01-02 22:19:14 +00:00
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
datafile: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const { datafile } = Astro.props
|
2024-01-04 23:43:02 +00:00
|
|
|
const fulldata = import.meta.glob<GlobAny>(`../content/data/*.json`)
|
|
|
|
const filecontent: FileData = (
|
2024-01-02 22:19:14 +00:00
|
|
|
await fulldata[`../content/data/${datafile}.json`]()
|
|
|
|
)['default']
|
|
|
|
|
2024-01-04 23:43:02 +00:00
|
|
|
const pagetitle = `${filecontent.info.title} - FGO TA`
|
2024-01-02 22:54:49 +00:00
|
|
|
filecontent.data.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))
|
2024-01-02 22:19:14 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
<Layout
|
2024-01-04 23:43:02 +00:00
|
|
|
title={pagetitle}
|
2024-01-02 22:19:14 +00:00
|
|
|
currentpage="database-entry"
|
|
|
|
descriptionOverride={filecontent.info.shortdescription}
|
|
|
|
>
|
|
|
|
<a href="/database"><< Back to database</a>
|
2024-01-04 23:43:02 +00:00
|
|
|
<BaseSection title={filecontent.info.title} description={filecontent.info.description}>
|
2024-01-02 22:19:14 +00:00
|
|
|
{filecontent.data.map((item) => <TACard {...item} />)}
|
|
|
|
</BaseSection>
|
|
|
|
<div class="placeholder"></div>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.placeholder {
|
|
|
|
visibility: hidden;
|
|
|
|
width: 100%;
|
|
|
|
height: 2.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
color: white;
|
|
|
|
background-color: var(--c-gray);
|
|
|
|
padding: 0.5rem 0px;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
</style>
|