components.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // @ts-nocheck
  2. import React from "react"
  3. import { Font, Text as JEText, type TextProps } from "@jsx-email/all"
  4. import { baseText } from "./styles"
  5. export function Text(props: TextProps) {
  6. return <JEText {...props} style={{ ...baseText, ...props.style }} />
  7. }
  8. export function Title({ children }: TitleProps) {
  9. return React.createElement("title", null, children)
  10. }
  11. export function A({ children, ...props }: AProps) {
  12. return React.createElement("a", props, children)
  13. }
  14. export function Span({ children, ...props }: SpanProps) {
  15. return React.createElement("span", props, children)
  16. }
  17. export function Fonts({ assetsUrl }: { assetsUrl: string }) {
  18. return (
  19. <>
  20. <Font
  21. fontFamily="JetBrains Mono"
  22. fallbackFontFamily="monospace"
  23. webFont={{
  24. url: `${assetsUrl}/JetBrainsMono-Regular.woff2`,
  25. format: "woff2",
  26. }}
  27. fontWeight="400"
  28. fontStyle="normal"
  29. />
  30. <Font
  31. fontFamily="JetBrains Mono"
  32. fallbackFontFamily="monospace"
  33. webFont={{
  34. url: `${assetsUrl}/JetBrainsMono-Medium.woff2`,
  35. format: "woff2",
  36. }}
  37. fontWeight="500"
  38. fontStyle="normal"
  39. />
  40. <Font
  41. fontFamily="Rubik"
  42. fallbackFontFamily={["Helvetica", "Arial", "sans-serif"]}
  43. webFont={{
  44. url: `${assetsUrl}/rubik-latin.woff2`,
  45. format: "woff2",
  46. }}
  47. fontWeight="400 500 600 700"
  48. fontStyle="normal"
  49. />
  50. </>
  51. )
  52. }