<script lang="ts">
  import TimelineItem from './TimelineItem.svelte'

  export interface Award {
    name: string
    description?: string
  }

  export interface TimelineEntry {
    school: string
    degree: string
    minor?: string
    gpa?: string
    location?: string
    startYear: number
    startMonth?: string
    endYear?: number
    endMonth?: string
    expected?: boolean
    courses?: string[]
    awards?: Award[]
  }

  interface Props {
    entries: TimelineEntry[]
  }

  let { entries }: Props = $props()
</script>

<div class="relative">
  {#each entries as entry}
    <TimelineItem
      school={entry.school}
      degree={entry.degree}
      minor={entry.minor}
      gpa={entry.gpa}
      location={entry.location}
      startYear={entry.startYear}
      startMonth={entry.startMonth}
      endYear={entry.endYear}
      endMonth={entry.endMonth}
      expected={entry.expected}
      courses={entry.courses}
      awards={entry.awards}
    />
  {/each}
</div>
