39 lines
1.5 KiB
TypeScript
39 lines
1.5 KiB
TypeScript
import type { BacktestRunDatasetSelection } from '@stock-bot/types';
|
|
|
|
/** This binding belongs to the accepted run, never the editable backtest form. */
|
|
export function RunDataset({ dataset }: { dataset?: BacktestRunDatasetSelection }) {
|
|
return (
|
|
<section
|
|
aria-label="Run dataset"
|
|
className="mb-4 rounded-lg border border-border p-3 text-sm text-text-secondary break-words"
|
|
>
|
|
{dataset?.pinnedHash ? (
|
|
<p>
|
|
Pinned dataset hash: <code>{dataset.pinnedHash}</code>
|
|
</p>
|
|
) : dataset?.requestedHash ? (
|
|
<>
|
|
<p>
|
|
Requested frozen dataset hash: <code>{dataset.requestedHash}</code>
|
|
</p>
|
|
<p>
|
|
{dataset.state === 'unavailable'
|
|
? 'Dataset preparation is unavailable for this run.'
|
|
: 'Waiting for dataset preparation and binding.'}
|
|
</p>
|
|
</>
|
|
) : dataset?.state === 'requested' ? (
|
|
<p>
|
|
Source request ({dataset.source ?? 'auto'}) — unpinned. Historical data will be prepared
|
|
asynchronously.
|
|
</p>
|
|
) : dataset?.state === 'preparing' ? (
|
|
<p>Source request ({dataset.source ?? 'auto'}) — unpinned. Historical data is preparing.</p>
|
|
) : dataset?.state === 'unavailable' ? (
|
|
<p>No dataset was pinned. Historical data preparation is unavailable for this run.</p>
|
|
) : (
|
|
<p>Dataset provenance is unavailable for this run.</p>
|
|
)}
|
|
</section>
|
|
);
|
|
}
|