add ui tip in records for current month
This commit is contained in:
@@ -916,6 +916,7 @@ export default function DashboardPage() {
|
||||
transactions={data.recentTransactions}
|
||||
hasData={hasTx}
|
||||
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
||||
userTimezone={userTimezone}
|
||||
/>
|
||||
</section>
|
||||
</section>
|
||||
@@ -1117,6 +1118,7 @@ export default function DashboardPage() {
|
||||
transactions={data.recentTransactions}
|
||||
hasData={hasTx}
|
||||
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
||||
userTimezone={userTimezone}
|
||||
/>
|
||||
</section>
|
||||
)}
|
||||
@@ -1278,19 +1280,29 @@ function RecentTransactionsPanel({
|
||||
transactions,
|
||||
hasData,
|
||||
rangeLabel,
|
||||
userTimezone,
|
||||
}: {
|
||||
transactions: DashboardResponse["recentTransactions"];
|
||||
hasData: boolean;
|
||||
rangeLabel?: string;
|
||||
userTimezone: string;
|
||||
}) {
|
||||
const title = rangeLabel ? "Transactions in window" : "Recent transactions";
|
||||
const visibleTransactions = transactions.slice(0, 10);
|
||||
const currentMonthLabel = new Intl.DateTimeFormat("en-US", {
|
||||
month: "long",
|
||||
year: "numeric",
|
||||
timeZone: userTimezone,
|
||||
}).format(new Date());
|
||||
|
||||
if (!hasData) {
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<h2 className="font-semibold">{title}</h2>
|
||||
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
||||
<div className="text-xs muted">
|
||||
Tip: Records defaults to This month ({currentMonthLabel}).
|
||||
</div>
|
||||
<EmptyState
|
||||
message="No transactions yet"
|
||||
actionLabel="Record one"
|
||||
@@ -1303,6 +1315,9 @@ function RecentTransactionsPanel({
|
||||
<div className="space-y-3">
|
||||
<h2 className="font-semibold">{title}</h2>
|
||||
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
||||
<div className="text-xs muted">
|
||||
Tip: Records defaults to This month ({currentMonthLabel}).
|
||||
</div>
|
||||
|
||||
{/* Desktop table view */}
|
||||
<div className="hidden sm:block border rounded-xl overflow-x-auto">
|
||||
@@ -1358,7 +1373,7 @@ function RecentTransactionsPanel({
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
<Link to="/records" className="btn text-sm">
|
||||
<Link to="/transactions" className="btn text-sm">
|
||||
View more
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user