import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
import { Controller } from 'react-hook-form';
import { ContentHeader } from '../../../lib/ui/layout/ContentHeader.js';
import { TimezonePicker } from '../../../lib/ui/TimezonePicker/TimezonePicker.js';
export function ClimateSettingScheduleFormTimezonePicker({ control, onClose, }) {
    const [title, setTitle] = useState(t.titleAuto);
    return (_jsxs(_Fragment, { children: [_jsx(ContentHeader, { title: title, onBack: onClose }), _jsx("div", { className: 'seam-main', children: _jsx(Controller, { name: 'timezone', control: control, render: ({ field }) => (_jsx(TimezonePicker, { ...field, onManualTimezoneSelected: (manualTimezoneSelected) => {
                            setTitle(manualTimezoneSelected ? t.titleManual : t.titleAuto);
                        } })) }) })] }));
}
const t = {
    titleAuto: 'Time Zone (automatic)',
    titleManual: 'Time Zone (manual)',
};
//# sourceMappingURL=ClimateSettingScheduleFormTimezonePicker.js.map