Files
requestarr/src/pages/book/[bookId]/index.tsx
root af6579163b
Some checks failed
Rebuild Issue Index / build-index (push) Has been cancelled
Add frontend pages for music and books
- 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
2026-04-03 21:19:40 -05:00

34 lines
827 B
TypeScript

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;