@@ -106,10 +106,10 @@ const DrawerContentWithTransition = ({
- {selectSensor}
+ {selectFarm}
- {selectSensorDescription}
+ {selectFarmDescription}
}
onClick={onShowAddForm}
>
- {addSensor}
+ {addFarm}
@@ -132,18 +132,19 @@ const TableModalSheet = ({ open, onClose }: TableModalSheetProps) => {
const t = useTranslations('sensorHub')
const [showAddForm, setShowAddForm] = useState(false)
const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'))
- const { setSensorHub } = useSensorHub()
+ const { setFarmHub } = useFarmHub()
const contentProps = {
- selectSensor: t('selectSensor'),
- selectSensorDescription: t('selectSensorDescription'),
- addSensor: t('addSensor')
+ selectFarm: t('selectSensor'),
+ selectFarmDescription: t('selectSensorDescription'),
+ addFarm: t('addSensor')
}
const handleBack = () => setShowAddForm(false)
- const handleConfirm = (sensor: Sensor) => {
- setSensorHub({ id: sensor.uuid_sensor, ...sensor })
+ const handleConfirm = (farm: Farm) => {
+ setFarmHub({ id: farm.farm_uuid, ...farm })
+ farmHubService.activateFarm(farm.farm_uuid).catch(() => {})
onClose()
}