---
import { getCollection } from 'astro:content';
import Layout from '../../layouts/Layout.astro'
import QuestListing from '../../components/listings/questListingCard.astro'
import DatabaseSection from '../../layouts/databaseSection.astro'
import SmallTitle from '../../components/smallTitle.astro';

const description = 'One of the most anticipated events of 2024 - Teslafest. Were the two weeks of time enough for all those quests, even with a parallel lottery?'
const fulldata = await getCollection('teslafest')

fulldata.sort(
  (a, b) => b.data.info.releaseDate.valueOf()  - a.data.info.releaseDate.valueOf()  ||  b.data.info.releaseNumber - a.data.info.releaseNumber
)

const gc = fulldata.filter((value) => value.id.startsWith("gc-"))
const mc = fulldata.filter((value) => value.id.startsWith("mc-"))
const cq = fulldata.filter((value) => value.id.startsWith("cq-"))
const eq_2021 = fulldata.filter((value) => value.id.startsWith("eq-2021"))
const eq_2020 = fulldata.filter((value) => value.id.startsWith("eq-2020"))

---

<Layout
  title="Teslafest - FGO TA"
  currentpage="teslafest"
  descriptionOverride={description}
>
  <SmallTitle maintext='TESLA&shy;FEST' subtext='' fadeout={true}/>
  <DatabaseSection title="Challenge Quest">
    {cq.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
  </DatabaseSection>
  <DatabaseSection title="Giga Coil">
    {gc.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
  </DatabaseSection>
  <DatabaseSection title="Mega Coil">
    {mc.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
  </DatabaseSection>
  <DatabaseSection title="Exhibition Quests: 2020 Revival">
    {eq_2020.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
  </DatabaseSection>
  <DatabaseSection title="Exhibition Quests: 2021 Revival">
    {eq_2021.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
  </DatabaseSection>
</Layout>

<style></style>