@hhgtech/hhg-components
Version:
Hello Health Group common components
39 lines (38 loc) • 1.2 kB
TypeScript
import React, { CSSProperties, ReactNode } from 'react';
import { Props as InputType } from "../../atoms/input";
export type SurveyOption = {
label: string;
image?: string;
value: string;
};
export type SurveyTextOption = {
label: string;
placeholder?: string;
inputType?: string;
name?: string;
isTextArea?: boolean;
value?: string;
type?: InputType['type'];
};
export type SurveyQuestion = {
type: 'checkbox' | 'radio' | 'textbox';
title?: ReactNode;
subtitle?: ReactNode;
image?: string;
options?: SurveyOption[];
textOptions?: SurveyTextOption[];
name?: string;
multi_select_option?: number | null;
is_multi_select?: boolean;
from?: number | null;
to?: number | null;
};
export type Props = {
question: SurveyQuestion;
description?: string;
onOptionsChange?: (c: SurveyOption[]) => void;
onTextOptionsChange?: (c: SurveyTextOption[]) => void;
className?: string;
style?: CSSProperties;
};
export declare const SurveyQuestionContent: ({ question, description, onOptionsChange, onTextOptionsChange, style, className, }: Props) => React.JSX.Element;