File size: 915 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export const formatBlogDate = (date: string) => {
  const dateObj = new Date(date)
  return dateObj.toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
  })
}

interface Author {
  name: string
  image: string
  x: { url: string; username: string }
}

const authorMap: Record<string, Author> = {
  sage: {
    name: "Segun Adebayo",
    image: "/authors/segun-headshot.png",
    x: { url: "https://x.com/thesegunadebayo", username: "@thesegunadebayo" },
  },
  esther: {
    name: "Esther Adebayo",
    image: "/authors/esther-headshot.jpg",
    x: { url: "https://x.com/_estheradebayo", username: "@_estheradebayo" },
  },
  eelco: {
    name: "Eelco Wiersma",
    image: "/authors/eelco-headshot.png",
    x: { url: "https://x.com/eelcodotdev", username: "@eelcodotdev" },
  },
}

export const getBlogAuthor = (author: string): Author => {
  return authorMap[author] ?? {}
}