feat: SW-276 Optimized code
This commit is contained in:
@@ -39,7 +39,7 @@ export default function ChildInfoSelector({
|
||||
{ label: "12", value: 12 },
|
||||
]
|
||||
|
||||
function handleOnSelect(selectedKey: any, childInfo: string) {
|
||||
function handleOnSelect(selectedKey: number, childInfo: string) {
|
||||
if (childInfo == "age") {
|
||||
child.age = selectedKey
|
||||
} else if (childInfo == "bed") {
|
||||
@@ -58,7 +58,7 @@ export default function ChildInfoSelector({
|
||||
aria-label={ageLabel}
|
||||
value={child.age}
|
||||
onSelect={(key) => {
|
||||
handleOnSelect(key, "age")
|
||||
handleOnSelect(parseInt(key.toString()), "age")
|
||||
}}
|
||||
name="age"
|
||||
placeholder={ageLabel}
|
||||
@@ -73,7 +73,7 @@ export default function ChildInfoSelector({
|
||||
aria-label={bedLabel}
|
||||
value={child.bed}
|
||||
onSelect={(key) => {
|
||||
handleOnSelect(key, "bed")
|
||||
handleOnSelect(parseInt(key.toString()), "bed")
|
||||
}}
|
||||
name="bed"
|
||||
placeholder={bedLabel}
|
||||
|
||||
Reference in New Issue
Block a user