Add frontend pages for music and books
Some checks failed
Rebuild Issue Index / build-index (push) Has been cancelled

- Create MusicDetails component with artist info, albums, stats, request button
- Create BookDetails component with cover, overview, request button
- Create music/[artistId] and book/[bookId] pages
- Update Search component with tabbed interface (Movies & TV, Music, Books)
- Music/Book search results with card grid and cover art
- Link to detail pages from search results
This commit is contained in:
root
2026-04-03 21:19:40 -05:00
parent 466db07e37
commit af6579163b
5 changed files with 546 additions and 12 deletions

View File

@@ -0,0 +1,33 @@
import BookDetails from '@app/components/BookDetails';
import axios from 'axios';
import type { GetServerSideProps, NextPage } from 'next';
interface BookPageProps {
book?: any;
}
const BookPage: NextPage<BookPageProps> = ({ book }) => {
return <BookDetails book={book} />;
};
export const getServerSideProps: GetServerSideProps<BookPageProps> = async (
ctx
) => {
try {
const response = await axios.get(
`http://${process.env.HOST || 'localhost'}:${
process.env.PORT || 5055
}/api/v1/book/search?query=${ctx.query.bookId}`,
{
headers: ctx.req?.headers?.cookie
? { cookie: ctx.req.headers.cookie }
: undefined,
}
);
return { props: { book: response.data?.results?.[0] } };
} catch {
return { props: {} };
}
};
export default BookPage;

View File

@@ -0,0 +1,33 @@
import MusicDetails from '@app/components/MusicDetails';
import axios from 'axios';
import type { GetServerSideProps, NextPage } from 'next';
interface MusicPageProps {
artist?: any;
}
const MusicPage: NextPage<MusicPageProps> = ({ artist }) => {
return <MusicDetails artist={artist} />;
};
export const getServerSideProps: GetServerSideProps<MusicPageProps> = async (
ctx
) => {
try {
const response = await axios.get(
`http://${process.env.HOST || 'localhost'}:${
process.env.PORT || 5055
}/api/v1/music/artist/${ctx.query.artistId}`,
{
headers: ctx.req?.headers?.cookie
? { cookie: ctx.req.headers.cookie }
: undefined,
}
);
return { props: { artist: response.data } };
} catch {
return { props: {} };
}
};
export default MusicPage;