kremalicious/blog

View on GitHub
src/components/CopyCode.astro

Summary

Maintainability
Test Coverage
---
import Copy from '@/components/Copy.astro'

type Props = {
  address: string
}

const { address }: Props = Astro.props
---

<style>
  .code {
    position: relative;
    padding: 0;
    width: 100%;
  }

  .code code {
    display: block;
    padding: calc(var(--spacer) / 2);
    padding-right: 2rem;
    font-size: var(--font-size-mini);
  }
</style>

<div class="code">
  <code>{address}</code>
  <Copy text={address} />
</div>