This commit is contained in:
Jake Kasper
2025-09-05 11:00:46 -04:00
parent f9bd7f6e18
commit 1b8dcab3e9

View File

@@ -367,11 +367,11 @@ const Watering = () => {
</div> </div>
<div className="card space-y-2"> <div className="card space-y-2">
<div className="font-medium">Plan</div> <div className="font-medium">Plan</div>
<div className="flex gap-2 items-center"> <select className="input w-full" value={plan?.id || ''} onChange={(e)=> selectPlan(e.target.value)} disabled={!selectedProperty}>
<select className="input flex-1" value={plan?.id || ''} onChange={(e)=> selectPlan(e.target.value)} disabled={!selectedProperty}> <option value="">-- Select plan --</option>
<option value="">-- Select plan --</option> {plans.map(pl => (<option key={pl.id} value={pl.id}>{pl.name}</option>))}
{plans.map(pl => (<option key={pl.id} value={pl.id}>{pl.name}</option>))} </select>
</select> <div className="flex gap-2 items-center flex-wrap">
<button className="btn-secondary" disabled={!selectedProperty} onClick={async ()=>{ <button className="btn-secondary" disabled={!selectedProperty} onClick={async ()=>{
const name = `Sprinklers ${new Date().toLocaleDateString()}`; const name = `Sprinklers ${new Date().toLocaleDateString()}`;
const r = await wateringAPI.createPlan({ propertyId: selectedProperty.id, name }); const r = await wateringAPI.createPlan({ propertyId: selectedProperty.id, name });