Add 5 and 10 minute refresh interval options

- Add 5, 10, and 15 minute intervals to both ProductForm and ProductDetail
- Show warning when 5 minute interval is selected (rate limiting risk)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-22 07:48:24 -05:00
parent 0a762eba76
commit e8123b27dc
2 changed files with 15 additions and 0 deletions

View file

@ -5,6 +5,8 @@ interface ProductFormProps {
} }
const REFRESH_INTERVALS = [ const REFRESH_INTERVALS = [
{ value: 300, label: '5 minutes' },
{ value: 600, label: '10 minutes' },
{ value: 900, label: '15 minutes' }, { value: 900, label: '15 minutes' },
{ value: 1800, label: '30 minutes' }, { value: 1800, label: '30 minutes' },
{ value: 3600, label: '1 hour' }, { value: 3600, label: '1 hour' },
@ -113,6 +115,11 @@ export default function ProductForm({ onSubmit }: ProductFormProps) {
</option> </option>
))} ))}
</select> </select>
{refreshInterval === 300 && (
<small style={{ color: 'var(--warning)', marginTop: '0.25rem', display: 'block' }}>
Warning: Very frequent checks may result in rate limiting
</small>
)}
</div> </div>
<button <button

View file

@ -30,6 +30,9 @@ export default function ProductDetail() {
const [notifyBackInStock, setNotifyBackInStock] = useState(false); const [notifyBackInStock, setNotifyBackInStock] = useState(false);
const REFRESH_INTERVALS = [ const REFRESH_INTERVALS = [
{ value: 300, label: '5 minutes' },
{ value: 600, label: '10 minutes' },
{ value: 900, label: '15 minutes' },
{ value: 1800, label: '30 minutes' }, { value: 1800, label: '30 minutes' },
{ value: 3600, label: '1 hour' }, { value: 3600, label: '1 hour' },
{ value: 7200, label: '2 hours' }, { value: 7200, label: '2 hours' },
@ -472,6 +475,11 @@ export default function ProductDetail() {
</option> </option>
))} ))}
</select> </select>
{product.refresh_interval === 300 && (
<small style={{ color: 'var(--warning)', marginTop: '0.25rem', display: 'block', fontSize: '0.75rem' }}>
Warning: May cause rate limiting
</small>
)}
</div> </div>
<div className="product-detail-meta-item"> <div className="product-detail-meta-item">
<span className="product-detail-meta-label">Tracking Since</span> <span className="product-detail-meta-label">Tracking Since</span>