Skip to content

Commit

Permalink
fix: sorted problem, issue movescriptions#9
Browse files Browse the repository at this point in the history
  • Loading branch information
phanker authored Jan 4, 2024
1 parent cddc8c7 commit 3ff127f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/tick-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ interface TickTableProps {
}

export default function TickTable(props: TickTableProps) {
const tickItems = Array.isArray(props.data)
? [...props.data].sort(
(a, b) => parseInt(a.start_time_ms) - parseInt(b.start_time_ms)
)
: []
return (
<div className="p-10">
<div className="flex justify-between">
Expand Down Expand Up @@ -56,7 +61,7 @@ export default function TickTable(props: TickTableProps) {
</tr>
</thead>
<tbody className="divide-y divide-gray-200 bg-white">
{props.data && props.data.map((tick) => (
{tickItems && tickItems.map((tick) => (
<tr key={tick.tick}>
<td className="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<div className="flex flex-row">
Expand Down

0 comments on commit 3ff127f

Please sign in to comment.