diff --git a/src/autorouting/AutoRoutingRoot.tsx b/src/autorouting/AutoRoutingRoot.tsx index 350172b..d12c702 100644 --- a/src/autorouting/AutoRoutingRoot.tsx +++ b/src/autorouting/AutoRoutingRoot.tsx @@ -1,11 +1,11 @@ import React, { useState, ChangeEvent } from 'react'; -import { Input, SelectInput } from "../ui"; +import { Input, SelectInput, FormButton } from "../ui"; const AutoRoutingRoot = () => { const [name, setName] = useState(''); const [eventType, setEventType] = useState([]); const [isActivated, setIsActivated] = useState(false); - const [condition, setCondition] = useState('AND'); + const [condition, setCondition] = useState([]); const [rule, setRule] = useState('value1'); const [destination, setDestination] = useState('value1'); @@ -16,6 +16,11 @@ const AutoRoutingRoot = () => { { label: 'NewPatient', value: 'NewPatient' } ]; + const conditionOptions = [ + { label: 'And', value: 'And' }, + { label: 'Or', value: 'Or' } + ]; + const handleInputChange = (event: ChangeEvent) => { setName(event.target.value); }; @@ -28,8 +33,8 @@ const AutoRoutingRoot = () => { setIsActivated(!isActivated); }; - const handleConditionChange = (event: ChangeEvent) => { - setCondition(event.target.value); + const handleConditionChange = (selectedOptions: any) => { + setCondition(selectedOptions); }; const handleRuleChange = (event: ChangeEvent) => { @@ -71,43 +76,40 @@ const AutoRoutingRoot = () => { style={{ marginBottom: '16px' }} /> - + options={conditionOptions} + placeholder="Select Label(s)" + aria-label="Labels" + /> - + - - + */} +
+

Hello, {name || 'world'}! Selected event type: {eventType.map(option => option.label).join(', ')}. Activated: {isActivated ? 'Yes' : 'No'}. Condition: {condition}. Rule: {rule}. Destination: {destination}.