too ocmplicatd

This commit is contained in:
legop3
2026-05-01 18:17:56 -04:00
parent 8550c85106
commit 3bb16c140e
3 changed files with 21 additions and 11 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" /> <meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title> <title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-P8Pgl_S6.js"></script> <script type="module" crossorigin src="/assets/index-Wmnr23kh.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Ddqa5PDb.css"> <link rel="stylesheet" crossorigin href="/assets/index-Ddqa5PDb.css">
</head> </head>
<body> <body>
+12 -2
View File
@@ -1,7 +1,7 @@
// Vip Neato Card // Vip Neato Card
// Purpose: Defines the Vip Neato Card module and the local helpers/components used in this file. // Purpose: Defines the Vip Neato Card module and the local helpers/components used in this file.
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit. // Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
import { useState } from 'react'; import { useEffect, useState } from 'react';
function normalizeState(value) { function normalizeState(value) {
return String(value || '').trim(); return String(value || '').trim();
@@ -66,6 +66,7 @@ export default function VipNeatoCard({
fullWidth = false, fullWidth = false,
}) { }) {
const [working, setWorking] = useState(''); const [working, setWorking] = useState('');
const [lidarFlash, setLidarFlash] = useState(false);
const wrapClass = fullWidth ? 'w-full' : 'w-full max-w-xl'; const wrapClass = fullWidth ? 'w-full' : 'w-full max-w-xl';
const configured = Boolean(neato?.configured); const configured = Boolean(neato?.configured);
@@ -117,6 +118,15 @@ export default function VipNeatoCard({
const primaryState = docked ? 'Docked' : uiStateLabel !== '--' ? uiStateLabel : 'Away from dock'; const primaryState = docked ? 'Docked' : uiStateLabel !== '--' ? uiStateLabel : 'Away from dock';
useEffect(() => {
if (!lidar || !Array.isArray(lidar.points)) return undefined;
setLidarFlash(true);
const timer = setTimeout(() => {
setLidarFlash(false);
}, 120);
return () => clearTimeout(timer);
}, [lidar]);
return ( return (
<section className={`surface text-sm text-slate-200 ${wrapClass}`}> <section className={`surface text-sm text-slate-200 ${wrapClass}`}>
<div className="grid gap-0.5"> <div className="grid gap-0.5">
@@ -225,7 +235,7 @@ export default function VipNeatoCard({
</div> </div>
</div> </div>
<div className="rounded-md bg-slate-800 px-1 py-0.5"> <div className={`rounded-md px-1 py-0.5 ${lidarFlash ? 'bg-emerald-900' : 'bg-slate-800'}`}>
<div className="text-[0.72rem] text-slate-300">Lidar</div> <div className="text-[0.72rem] text-slate-300">Lidar</div>
<div className="mt-0.25 aspect-square rounded-md bg-slate-900 p-0.25"> <div className="mt-0.25 aspect-square rounded-md bg-slate-900 p-0.25">
{lidarDots ? ( {lidarDots ? (