Fix duration format and minimized chat layout

- Format duration as hours+minutes when > 60min (e.g., 2h 26min)
- Change minimized chat to compact chip style (matching web)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
esdrasrenan 2025-12-07 14:37:28 -03:00
parent 229c9aa1c7
commit 409da8afda
2 changed files with 22 additions and 18 deletions

View file

@ -54,6 +54,18 @@ type ChatSession = {
const MESSAGES_PER_PAGE = 20
function formatDuration(minutes: number): string {
if (minutes < 60) {
return `${minutes} min`
}
const hours = Math.floor(minutes / 60)
const mins = minutes % 60
if (mins === 0) {
return `${hours}h`
}
return `${hours}h ${mins}min`
}
function MessageAttachmentPreview({ attachment }: { attachment: { storageId: string; name: string; type: string | null } }) {
const getFileUrl = useAction(api.files.getUrl)
const [loading, setLoading] = useState(false)
@ -147,7 +159,7 @@ function ChatSessionCard({ session, isExpanded, onToggle }: { session: ChatSessi
<span>-</span>
<span>{session.messageCount} mensagens</span>
<span>-</span>
<span>{duration} min</span>
<span>{formatDuration(duration)}</span>
</div>
</div>
</div>