'use client' import React, { useState } from 'react' import { PatternFormat } from '../PatternFormat' import { Icon } from '../../../atoms' import { getGlobalStyle } from '../../../../utils' import styles from './styles.module.css' interface InputTimeHoursProps { times?: string[] width?: string value?: string placeholder?: string info?: string | null disabled?: boolean error?: boolean onSelected?: (time: string) => void onChange?: (event: React.ChangeEvent) => void } export const InputTimeHours: React.FC = ({ times = [], width, value, placeholder, info = '', error, disabled = false, onSelected = (time) => time ?? '', onChange = (event) => event }) => { const [showSuggestions, setShowSuggestions] = useState(false) const handleSuggestionsClick = (event: React.MouseEvent): any => { event.stopPropagation() } return (
setShowSuggestions(true)} onBlur={() => { setTimeout(() => setShowSuggestions(false), 100) }} className={styles.input} onChange={(event: React.ChangeEvent) => { if (event !== null) onChange(event) }} /> {info !== '' && <> {info} } {showSuggestions && (
    {times.map((time) => (
  • { onSelected(time) setShowSuggestions(false) }} > {time}
  • ))}
)}
) }