diff --git a/src/components/TickerName.tsx b/src/components/TickerName.tsx index 11d0103..39adea4 100644 --- a/src/components/TickerName.tsx +++ b/src/components/TickerName.tsx @@ -1,9 +1,14 @@ 'use client'; import { ITradeView } from "@/lib/types"; import { shortDateFormatter } from "./trades"; - +import dayjs from "dayjs"; export const TickerName = (p: { trade: ITradeView; }) => { const { trade } = p; - return
{trade.symbol} {trade.strikePrice as unknown as string} {shortDateFormatter(trade.contractExpiry as unknown as string)} x {trade.numberOfContracts}
; + const dt = trade.contractExpiry; + const isYearAfter = dayjs(dt).diff(dayjs(), 'days') > 365; + const fmtDate = isYearAfter ? dayjs(dt).format('M/D/YY') : dayjs(dt).format('M/D'); + return
+ {trade.symbol} {trade.strikePrice as unknown as string} {fmtDate} x {trade.numberOfContracts} +
; }; diff --git a/src/components/progress-bar.tsx b/src/components/progress-bar.tsx index 4273347..0831890 100644 --- a/src/components/progress-bar.tsx +++ b/src/components/progress-bar.tsx @@ -47,39 +47,30 @@ export const ProgressBar = React.memo(function ProgressBar(props: ProgressBarPro const { value, formattedValue } = props; const valueInPercent = value * 100; let color = getColor(valueInPercent * 10); - - return ( - - {/* + {/* */} - {/*
*/} - {formattedValue} ({valueInPercent.toFixed()}%) - - {/* {formattedValue} */} - - {/* = 30 && valueInPercent <= 70, - high: valueInPercent > 70, - })} - style={{ maxWidth: `${valueInPercent}%` }} - /> */} -
- ); + {/*
*/} + {formattedValue} ({valueInPercent.toFixed()}%) + + {/* {formattedValue} */} + + + ); + } }); - - // export function renderProgress(params: GridRenderCellParams) { // if (params.value == null) { // return '';