feat(admin): truck report link + pre-fill form via ?truck_id=
Scanning truck QR opens /ims/report?truck_id=<id>, which pre-selects incident_type=transport and the truck in the form. TruckManager shows "Report link / QR target" per truck, mirroring zones. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPf5Rc8QPx6V8KLEEgfKEQ
This commit is contained in:
@@ -89,16 +89,25 @@ export function TruckManager({ trucks }: Props) {
|
||||
) : (
|
||||
<ul className="divide-y divide-gray-100">
|
||||
{trucks.map(tk => (
|
||||
<li key={tk.id} className="flex items-center gap-3 py-2">
|
||||
<span className="text-sm font-medium text-gray-900">{tk.truck_no}</span>
|
||||
{tk.carrier && (
|
||||
<span className="text-xs text-gray-500">{tk.carrier}</span>
|
||||
)}
|
||||
{!tk.active && (
|
||||
<span className="ml-auto text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 text-gray-500">
|
||||
Inactive
|
||||
</span>
|
||||
)}
|
||||
<li key={tk.id} className="flex items-center justify-between py-2">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-sm font-medium text-gray-900">{tk.truck_no}</span>
|
||||
{tk.carrier && (
|
||||
<span className="text-xs text-gray-500">{tk.carrier}</span>
|
||||
)}
|
||||
{!tk.active && (
|
||||
<span className="text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 text-gray-500">
|
||||
Inactive
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<a
|
||||
href={`/ims/report?truck_id=${tk.id}`}
|
||||
target="_blank"
|
||||
className="text-xs text-blue-600 hover:underline"
|
||||
>
|
||||
Report link / QR target
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user