|
1 | | -import { type ReadonlySignal, component$ } from '@builder.io/qwik'; |
| 1 | +import { component$, type ReadonlySignal } from '@builder.io/qwik'; |
2 | 2 | import { routeLoader$ } from '@builder.io/qwik-city'; |
3 | | -import { getDB, errorTable, type ErrorRow } from '~/db'; |
4 | 3 | import { eq, sql } from 'drizzle-orm'; |
5 | 4 | import { ErrorIcon } from '~/components/icons/error'; |
6 | | -import { type PopupEvent } from '~/components/popup-manager'; |
| 5 | +import { TooltipWrapper } from '~/components/tooltip'; |
| 6 | +import { errorTable, getDB, type ErrorRow } from '~/db'; |
7 | 7 |
|
8 | 8 | export const useErrors = routeLoader$(async ({ params }) => { |
9 | 9 | const db = getDB(); |
@@ -41,23 +41,21 @@ export default component$(() => { |
41 | 41 | </thead> |
42 | 42 | <tbody> |
43 | 43 | {errors.value.map((error) => ( |
44 | | - <tr |
45 | | - key={error.id} |
46 | | - onPopup$={(e: PopupEvent) => e.detail.show(Popup, error)} |
47 | | - class="border-b border-slate-200 text-xs" |
48 | | - > |
49 | | - <td scope="col" class="px-6 py-3 bg-slate-50 whitespace-nowrap"> |
50 | | - {new Date(error.timestamp).toLocaleString()} |
51 | | - </td> |
52 | | - <td scope="col" class="px-6 py-3 max-w-lg break-words"> |
53 | | - <a href={error.url} target="_blank"> |
54 | | - {error.url} |
55 | | - </a> |
56 | | - </td> |
57 | | - <td scope="col" class="px-6 py-3 bg-slate-50"> |
58 | | - {error.message} |
59 | | - </td> |
60 | | - </tr> |
| 44 | + <TooltipWrapper key={error.id} content={Popup} contentProps={error} placement="left"> |
| 45 | + <tr class="border-b border-slate-200 text-xs hover:bg-slate-50 cursor-pointer"> |
| 46 | + <td scope="col" class="px-6 py-3 bg-slate-50 whitespace-nowrap"> |
| 47 | + {new Date(error.timestamp).toLocaleString()} |
| 48 | + </td> |
| 49 | + <td scope="col" class="px-6 py-3 max-w-lg break-words"> |
| 50 | + <a href={error.url} target="_blank"> |
| 51 | + {error.url} |
| 52 | + </a> |
| 53 | + </td> |
| 54 | + <td scope="col" class="px-6 py-3 bg-slate-50"> |
| 55 | + {error.message} |
| 56 | + </td> |
| 57 | + </tr> |
| 58 | + </TooltipWrapper> |
61 | 59 | ))} |
62 | 60 | </tbody> |
63 | 61 | </table> |
|
0 commit comments