Skip to content

Commit

Permalink
[C] add numbers to review + xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Apr 12, 2024
1 parent d8eaff8 commit 96df955
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/api/xlsx/formatter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import select from "./select";
import multiPart from "./inline";
import widget from "./widget";
import tabular from "./tabular";
import calculator from './calculator'
import calculator from "./calculator";
import { InlineQuestionData, TextInput, WidgetInput } from "@/types/answers";
import {
InlineReviewProps,
ReviewPart,
} from "@/components/questions/Review/Inline";
import { Equation } from "@/types/calculators";
import { AnswerType } from "@/types/questions";

interface FormatterBaseProps<T = any> {
locale: string;
Expand Down Expand Up @@ -69,14 +70,15 @@ type Formatter =
| TabularFormatter
| CalculatorFormatter;

const formatters: Record<string, Formatter> = {
const formatters: Record<AnswerType, Formatter> = {
text,
textarea: text,
select,
widget,
multiPart,
tabular,
calculator,
number: text,
};

export default formatters;
1 change: 1 addition & 0 deletions components/factories/ReviewFactory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const QUESTION_MAP: Record<AnswerType, ComponentType<any>> = {
multiPart: Review.Inline,
tabular: Review.Tabular,
calculator: Review.Calculator,
number: Review.Text,
};

const ReviewFactory: FunctionComponent<ReviewProps> = ({
Expand Down

0 comments on commit 96df955

Please sign in to comment.