File size: 885 Bytes
721d060
 
 
 
8bdc503
 
 
 
721d060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import * as Montserrat from "@remotion/google-fonts/Montserrat";

export function ErrorMsg(props: { error?: string, children?: any }) {

  const { fontFamily } = Montserrat.loadFont("normal", {
    weights: ["500"],
    ignoreTooManyRequestsWarning: true
  });
  const baseStyle = {
    borderColor: "transparent",
    borderRadius: "2rem",
    borderLeftWidth: "4px",
    borderRightWidth: "4px",
    color: "#fff",
    textShadow: "0px 0px 50px #000, 0px 0px 50px #000",
    padding: "0.2rem 1.5rem",
  };

  return (
    <center style={{
      width: '100%',
      height: '100%',
      justifyContent: 'center',
      alignItems: 'center',
      alignContent: 'center'
    }}>
      <span style={{
        ...baseStyle,
        fontFamily,
        fontSize: 42,
      }}>
        {props.error || props.children || 'An error occurred in rendering'}
      </span>
    </center>
  )
}