diff --git a/src/components/MarkFormField/index.tsx b/src/components/MarkFormField/index.tsx index 9a14989..7328065 100644 --- a/src/components/MarkFormField/index.tsx +++ b/src/components/MarkFormField/index.tsx @@ -7,13 +7,12 @@ import { isCurrentValueLast } from '../../utils' import React, { useState } from 'react' +import { MARK_TYPE_CONFIG } from '../getMarkComponents.tsx' interface MarkFormFieldProps { currentUserMarks: CurrentUserMark[] handleCurrentUserMarkChange: (mark: CurrentUserMark) => void - handleSelectedMarkValueChange: ( - event: React.ChangeEvent - ) => void + handleSelectedMarkValueChange: (value: string) => void handleSubmit: (event: React.FormEvent) => void selectedMark: CurrentUserMark selectedMarkValue: string @@ -53,6 +52,8 @@ const MarkFormField = ({ } const toggleActions = () => setDisplayActions(!displayActions) const markLabel = getToolboxLabelByMarkType(selectedMark.mark.type) + const { input: MarkInputComponent } = + MARK_TYPE_CONFIG[selectedMark.mark.type] || {} return (
@@ -83,12 +84,14 @@ const MarkFormField = ({
handleFormSubmit(e)}> - + {typeof MarkInputComponent !== 'undefined' && ( + + )}