import { jsx as _jsx } from "react/jsx-runtime";
import { isNoiseSensorDevice, isThermostatDevice } from 'seamapi';
import { withRequiredCommonProps, } from '../../../../lib/seam/components/common-props.js';
import { LockDeviceDetails } from '../../../../lib/seam/components/DeviceDetails/LockDeviceDetails.js';
import { NoiseSensorDeviceDetails } from '../../../../lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js';
import { ThermostatDeviceDetails } from '../../../../lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js';
import { useDevice } from '../../../../lib/seam/devices/use-device.js';
import { isLockDevice } from '../../../../lib/seam/locks/lock-device.js';
import { useComponentTelemetry } from '../../../../lib/telemetry/index.js';
export const NestedDeviceDetails = withRequiredCommonProps(DeviceDetails);
export function DeviceDetails({ deviceId, errorFilter = () => true, warningFilter = () => true, disableLockUnlock = false, disableDeleteAccessCode = false, disableResourceIds = false, disableConnectedAccountInformation = false, disableCreateAccessCode = false, disableEditAccessCode = false, disableClimateSettingSchedules = false, onBack, className, }) {
    useComponentTelemetry('DeviceDetails');
    const { device } = useDevice({
        device_id: deviceId,
    });
    if (device == null) {
        return null;
    }
    const props = {
        errorFilter,
        warningFilter,
        disableLockUnlock,
        disableDeleteAccessCode,
        disableResourceIds,
        disableConnectedAccountInformation,
        disableCreateAccessCode,
        disableEditAccessCode,
        disableClimateSettingSchedules,
        onBack,
        className,
    };
    if (isLockDevice(device)) {
        return _jsx(LockDeviceDetails, { device: device, ...props });
    }
    if (isThermostatDevice(device)) {
        return _jsx(ThermostatDeviceDetails, { device: device, ...props });
    }
    if (isNoiseSensorDevice(device)) {
        return _jsx(NoiseSensorDeviceDetails, { device: device, ...props });
    }
    return null;
}
//# sourceMappingURL=DeviceDetails.js.map