---
import katex from 'katex'
import * as interfaces from '../../lib/interfaces.ts'

export interface Props {
  block: interfaces.Block
}

const { block }: Props = Astro.props

if (!block.Equation) {
  return null
}
---

<div
  class="equation"
  set:html={katex.renderToString(block.Equation.Expression, {
    throwOnError: false,
  })}
/>

<style>
  .equation {
    text-align: center;
  }
</style>
