mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 16:19:24 -07:00
style(stats): fix prettier formatting in LibrarySummarySection
This commit is contained in:
@@ -1,13 +1,5 @@
|
|||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import {
|
import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
||||||
Bar,
|
|
||||||
BarChart,
|
|
||||||
CartesianGrid,
|
|
||||||
ResponsiveContainer,
|
|
||||||
Tooltip,
|
|
||||||
XAxis,
|
|
||||||
YAxis,
|
|
||||||
} from 'recharts';
|
|
||||||
import type { LibrarySummaryRow } from '../../types/stats';
|
import type { LibrarySummaryRow } from '../../types/stats';
|
||||||
import { CHART_DEFAULTS, CHART_THEME, TOOLTIP_CONTENT_STYLE } from '../../lib/chart-theme';
|
import { CHART_DEFAULTS, CHART_THEME, TOOLTIP_CONTENT_STYLE } from '../../lib/chart-theme';
|
||||||
import { epochDayToDate, formatDuration, formatNumber } from '../../lib/formatters';
|
import { epochDayToDate, formatDuration, formatNumber } from '../../lib/formatters';
|
||||||
@@ -132,9 +124,7 @@ export function LibrarySummarySection({ rows, hiddenTitles }: LibrarySummarySect
|
|||||||
if (visibleRows.length === 0) {
|
if (visibleRows.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
||||||
<div className="text-xs text-ctp-overlay2">
|
<div className="text-xs text-ctp-overlay2">No library activity in the selected window.</div>
|
||||||
No library activity in the selected window.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -151,9 +141,7 @@ export function LibrarySummarySection({ rows, hiddenTitles }: LibrarySummarySect
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
||||||
<h3 className="text-xs font-semibold text-ctp-text mb-2">
|
<h3 className="text-xs font-semibold text-ctp-text mb-2">Top Titles by Watch Time (min)</h3>
|
||||||
Top Titles by Watch Time (min)
|
|
||||||
</h3>
|
|
||||||
<ResponsiveContainer width="100%" height={LEADERBOARD_HEIGHT}>
|
<ResponsiveContainer width="100%" height={LEADERBOARD_HEIGHT}>
|
||||||
<BarChart
|
<BarChart
|
||||||
data={leaderboard}
|
data={leaderboard}
|
||||||
@@ -190,10 +178,7 @@ export function LibrarySummarySection({ rows, hiddenTitles }: LibrarySummarySect
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
<div className="col-span-full rounded-lg border border-ctp-surface1 bg-ctp-surface0 p-4">
|
||||||
<h3 className="text-xs font-semibold text-ctp-text mb-2">Per-Title Summary</h3>
|
<h3 className="text-xs font-semibold text-ctp-text mb-2">Per-Title Summary</h3>
|
||||||
<div
|
<div className="overflow-auto" style={{ maxHeight: TABLE_MAX_HEIGHT }}>
|
||||||
className="overflow-auto"
|
|
||||||
style={{ maxHeight: TABLE_MAX_HEIGHT }}
|
|
||||||
>
|
|
||||||
<table className="w-full text-xs">
|
<table className="w-full text-xs">
|
||||||
<thead className="sticky top-0 bg-ctp-surface0">
|
<thead className="sticky top-0 bg-ctp-surface0">
|
||||||
<tr className="border-b border-ctp-surface1 text-ctp-subtext0">
|
<tr className="border-b border-ctp-surface1 text-ctp-subtext0">
|
||||||
@@ -247,9 +232,7 @@ export function LibrarySummarySection({ rows, hiddenTitles }: LibrarySummarySect
|
|||||||
{formatNumber(row.lookups)}
|
{formatNumber(row.lookups)}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 py-2 text-right text-ctp-text tabular-nums">
|
<td className="px-2 py-2 text-right text-ctp-text tabular-nums">
|
||||||
{row.lookupsPerHundred === null
|
{row.lookupsPerHundred === null ? '—' : row.lookupsPerHundred.toFixed(1)}
|
||||||
? '—'
|
|
||||||
: row.lookupsPerHundred.toFixed(1)}
|
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 py-2 text-right text-ctp-subtext0 tabular-nums">
|
<td className="px-2 py-2 text-right text-ctp-subtext0 tabular-nums">
|
||||||
{formatDateRange(row.firstWatched, row.lastWatched)}
|
{formatDateRange(row.firstWatched, row.lastWatched)}
|
||||||
|
|||||||
Reference in New Issue
Block a user