All files / js/widgets fakeWidgets.tsx

54.55% Statements 6/11
0% Branches 0/6
0% Functions 0/4
54.55% Lines 6/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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  1x 1x         1x         1x                         1x         1x  
import { Field } from "./types";
import React from "react";
import { trans_obj } from "../i18n";
 
export function LineWidget() {
  return <hr />;
}
LineWidget.isFakeWidget = true;
 
export function SpacingWidget() {
  return <div className="spacing" />;
}
SpacingWidget.isFakeWidget = true;
 
export function InfoWidget(props: { field: Field }) {
  const label = trans_obj(props.field.label_i18n);
  return (
    <div className="info">
      <p>
        {label ? <strong>{label + ": "}</strong> : null}
        {trans_obj(props.field.description_i18n)}
      </p>
    </div>
  );
}
InfoWidget.isFakeWidget = true;
 
export function HeadingWidget(props: { field: Field }) {
  return <h3>{trans_obj(props.field.type.heading_i18n ?? {})}</h3>;
}
HeadingWidget.isFakeWidget = true;