Part of the quiet-user-feedback change; docs and specs land in their own repositories.
25 lines
589 B
TypeScript
25 lines
589 B
TypeScript
import type { FC } from "react";
|
|
|
|
import { Navigate } from "react-router";
|
|
|
|
import { InstrumentPageState } from "@/features/instrument-details";
|
|
|
|
import { StockPageView } from "./StockPage.view";
|
|
import { useStockPageVm } from "./StockPage.vm";
|
|
|
|
const StockPage: FC = () => {
|
|
const vm = useStockPageVm();
|
|
if (vm.canonicalTo) return <Navigate replace to={vm.canonicalTo} />;
|
|
if (vm.stockState.loading || !vm.stock) return (
|
|
<InstrumentPageState
|
|
code={vm.code}
|
|
kind="stock"
|
|
loading={vm.stockState.loading}
|
|
/>
|
|
);
|
|
|
|
return <StockPageView vm={vm} />;
|
|
};
|
|
|
|
export { StockPage };
|