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