Market View: make Scrape 7d/30d buttons gold with icon, right-aligned
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
77284b3ecc
commit
de8c4ec257
1 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useMemo, useCallback, useEffect } from 'react'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { Eye } from 'lucide-react'
|
||||
import { Eye, RefreshCw } from 'lucide-react'
|
||||
import api from '../api'
|
||||
|
||||
// Format Date as YYYY-MM-DD using local time (avoids UTC/DST shift from toISOString)
|
||||
|
|
@ -1149,7 +1149,7 @@ const RateMatrixTab: React.FC = () => {
|
|||
</button>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
|
||||
<div style={{ display: 'flex', gap: 6, alignItems: 'center', marginLeft: 'auto' }}>
|
||||
{[{ label: 'Scrape 7d', days: 7 }, { label: 'Scrape 30d', days: 30 }].map(p => {
|
||||
const from = fmtDate(new Date())
|
||||
const to = fmtDate(new Date(Date.now() + (p.days - 1) * 86400000))
|
||||
|
|
@ -1157,11 +1157,12 @@ const RateMatrixTab: React.FC = () => {
|
|||
const active = activeJob && activeJob.from === from && activeJob.to === to
|
||||
return (
|
||||
<button key={p.label}
|
||||
style={buttonStyle('outline', 'small')}
|
||||
style={{ ...buttonStyle('primary', 'small'), opacity: queued ? 0.7 : 1, display: 'inline-flex', alignItems: 'center', gap: 5 }}
|
||||
disabled={queued}
|
||||
onClick={() => enqueueScrape(from, to)}
|
||||
title={`Scrape today + next ${p.days - 1} days (~${p.days} min)`}
|
||||
>
|
||||
<RefreshCw size={13} strokeWidth={1.75} style={active ? { animation: 'spin 1.5s linear infinite' } : undefined} />
|
||||
{active ? 'Scraping…' : queued ? 'Queued' : p.label}
|
||||
</button>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue