Skip to content

Commit

Permalink
clients/web: fix rule of hook in MeterEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Feb 3, 2025
1 parent aa6da70 commit cc26538
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions clients/apps/web/src/components/Meter/MeterEvents.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Event } from '@polar-sh/api'
import Avatar from '@polar-sh/ui/components/atoms/Avatar'
import { DataTable } from '@polar-sh/ui/components/atoms/DataTable'
import { useMemo } from 'react'

export const MeterEvents = ({ events }: { events: Event[] }) => {
return (
Expand Down Expand Up @@ -35,15 +34,15 @@ export const MeterEvents = ({ events }: { events: Event[] }) => {
header: 'Created At',
accessorKey: 'timestamp',
cell: ({ row: { original: event } }) => {
const formattedTimestamp = useMemo(() => {
return new Date(event.timestamp).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
}, [event.timestamp])
const formattedTimestamp = new Date(
event.timestamp,
).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
return (
<span className="font-mono text-xs capitalize">
{formattedTimestamp}
Expand Down

0 comments on commit cc26538

Please sign in to comment.