Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Nov 19, 2024
1 parent 37758ce commit c046095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
2 changes: 2 additions & 0 deletions apps/registry/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
'@next/next/no-sync-scripts': 'off',
'@next/next/no-page-custom-font': 'off',
'@next/next/no-img-element': 'off',
'react/no-unescaped-entities': 'off',
'no-case-declarations': 'off',
},
env: {
browser: true,
Expand Down
20 changes: 0 additions & 20 deletions apps/registry/app/jobs/[uuid]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,6 @@ export default function JobPage({ params }) {
);
}

const timeAgo = (date) => {
const seconds = Math.floor((new Date() - new Date(date)) / 1000);
const intervals = {
year: 31536000,
month: 2592000,
week: 604800,
day: 86400,
hour: 3600,
minute: 60,
};

for (const [unit, secondsInUnit] of Object.entries(intervals)) {
const interval = Math.floor(seconds / secondsInUnit);
if (interval >= 1) {
return interval === 1 ? `1 ${unit} ago` : `${interval} ${unit}s ago`;
}
}
return 'Just now';
};

const gptContent =
job.gpt_content && job.gpt_content !== 'FAILED'
? JSON.parse(job.gpt_content)
Expand Down

0 comments on commit c046095

Please sign in to comment.