Low-Dimensional Nanomaterials for Thermoelectric Detection of Infrared and Terahertz Photons