Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/web/src/components/dashboard/overview-stats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useState } from 'react'
import { useState, useId } from 'react'
import { cn } from '@/lib/utils'
import { formatTokens, formatCost } from '@/lib/format'

Expand Down Expand Up @@ -56,6 +56,7 @@ export function OverviewStats({
rangeSelector,
}: OverviewStatsProps) {
const [expanded, setExpanded] = useState(false)
const helpId = useId()

return (
<div className="rounded-xl bg-card ring-1 ring-foreground/10 p-4 sm:p-5">
Expand Down Expand Up @@ -85,15 +86,17 @@ export function OverviewStats({
<button
type="button"
onClick={() => setExpanded(v => !v)}
className="mt-4 flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors"
className="mt-4 flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-card"
aria-expanded={expanded}
aria-controls={expanded ? helpId : undefined}
>
<span className={cn('inline-block transition-transform', expanded && 'rotate-90')}>β–Έ</span>
<span className={cn('inline-block transition-transform', expanded && 'rotate-90')} aria-hidden="true">β–Έ</span>
<span className="font-medium text-foreground">What do these numbers mean?</span>
<span>β€” {expanded ? 'click to collapse' : 'click to expand'}</span>
<span aria-hidden="true">β€” {expanded ? 'click to collapse' : 'click to expand'}</span>
</button>

{expanded && (
<div className="mt-3 text-xs text-muted-foreground space-y-2 leading-relaxed">
<div id={helpId} className="mt-3 text-xs text-muted-foreground space-y-2 leading-relaxed">
<p>
<span className="font-medium text-foreground">Sessions</span> β€” νŒ€μ›λ“€μ΄ μ‹œμž‘ν•œ Claude Code μ„Έμ…˜ 수.
</p>
Expand Down
Loading