Skip to content

Commit 479cf8c

Browse files
committed
Clean up code
1 parent 9eefb4d commit 479cf8c

File tree

1 file changed

+4
-8
lines changed
  • src/app/(stupid)/[artistSlug]/[year]/[month]

1 file changed

+4
-8
lines changed

src/app/(stupid)/[artistSlug]/[year]/[month]/page.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import RelistenAPI from '@/lib/RelistenAPI';
2+
import { format } from 'date-fns';
23
import { Metadata } from 'next';
34
import Link from 'next/link';
45
import { notFound } from 'next/navigation';
5-
import { format } from 'date-fns';
66

77
interface Props {
88
params: Promise<{ artistSlug: string; year: string; month: string }>;
@@ -17,10 +17,8 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
1717
return { title: 'Not Found' };
1818
}
1919

20-
const monthName = format(new Date(parseInt(year), parseInt(month) - 1, 1), 'MMMM');
21-
2220
return {
23-
title: `Index of /${artist.name}/${year}/${monthName}`,
21+
title: `Index of /${artist.slug}/${year}/${month}`,
2422
};
2523
}
2624

@@ -65,12 +63,10 @@ export default async function MonthPage({ params }: Props) {
6563
(a, b) => new Date(a.display_date || '').getTime() - new Date(b.display_date || '').getTime()
6664
);
6765

68-
const monthName = format(new Date(parseInt(year), parseInt(month) - 1, 1), 'MMMM');
69-
7066
return (
7167
<div className="bg-white p-4 font-serif text-black">
7268
<h1 className="mb-4 text-2xl font-bold">
73-
Index of /{artist.slug}/{year}/{monthName}/
69+
Index of /{artist.slug}/{year}/{month}/
7470
</h1>
7571
<table className="border-collapse">
7672
<tbody>
@@ -227,7 +223,7 @@ export default async function MonthPage({ params }: Props) {
227223
{monthShows.length === 0 && (
228224
<tr>
229225
<td colSpan={5} className="pt-4 pb-4 text-center">
230-
No shows found for {monthName} {year}
226+
No files found for /{artistSlug}/{year}/{month}
231227
</td>
232228
</tr>
233229
)}

0 commit comments

Comments
 (0)