Show last-found location and time on the object card

Surfaces last_seen_location/last_seen_at (recorded by inventory
audit scans) on both the admin edit page and the public QR-scan
detail page, so it's visible without having to check the audit list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jze9
2026-07-22 15:50:37 +05:00
parent d6a7ac0a68
commit b2398ad364
2 changed files with 13 additions and 0 deletions

View File

@@ -122,6 +122,13 @@ export function ObjectFormPage() {
<div className="mx-auto max-w-lg space-y-6">
<h1 className="text-xl font-semibold">{isEditing ? 'Изменить объект' : 'Новый объект'}</h1>
{object?.last_seen_at && (
<p className="text-sm text-slate-500 dark:text-slate-400">
Последний раз найден{object.last_seen_location ? `: ${object.last_seen_location}` : ''} ·{' '}
{new Date(object.last_seen_at).toLocaleString('ru-RU', { dateStyle: 'medium', timeStyle: 'short' })}
</p>
)}
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
<div className="space-y-1">
<label className="text-sm font-medium">Инвентарный номер</label>

View File

@@ -23,6 +23,12 @@ export function ObjectDetailPage() {
<div>
<h1 className="text-2xl font-semibold text-slate-900 dark:text-slate-100">{object.name}</h1>
<p className="text-sm text-slate-500 dark:text-slate-400">Инв. номер: {object.inventory_number}</p>
{object.last_seen_at && (
<p className="text-sm text-slate-500 dark:text-slate-400">
Последний раз найден{object.last_seen_location ? `: ${object.last_seen_location}` : ''} ·{' '}
{new Date(object.last_seen_at).toLocaleString('ru-RU', { dateStyle: 'medium', timeStyle: 'short' })}
</p>
)}
</div>
{object.description && (
<p className="whitespace-pre-wrap text-slate-700 dark:text-slate-300">{object.description}</p>