kremalicious/blog

View on GitHub
src/layouts/Post/Actions.astro

Summary

Maintainability
Test Coverage
---
import { Bitcoin, Github, Mastodon } from '@/images/components'
import config from '@config/blog.config'
import Action from './Action.astro'
import styles from './Actions.module.css'

type Props = {
  githubLink: string
}

const { githubLink } = Astro.props

const actions = [
  {
    title: 'Have a comment?',
    text: 'Hit me up @krema@mas.to',
    url: config.author.mastodon,
    icon: Mastodon
  },
  {
    title: 'Found something useful?',
    text: 'Say thanks with BTC or ETH',
    url: '/thanks/',
    icon: Bitcoin
  },
  {
    title: 'Edit on GitHub',
    text: 'Contribute to this post',
    url: githubLink,
    icon: Github
  }
]
---

<section class={styles.actions}>
  {
    actions.map((action) => (
      <Action
        title={action.title}
        text={action.text}
        url={action.url}
        icon={action.icon}
      />
    ))
  }
</section>