mirror of
https://github.com/ngthanhvu/kr-phim.git
synced 2026-08-10 15:07:46 +00:00
feat: implement AppHeader with authentication, search, and navigation, plus add movie utility types and showtimes page skeleton
This commit is contained in:
@@ -16,6 +16,7 @@ export interface NormalizedMovie {
|
||||
lang?: string
|
||||
type?: string
|
||||
rating?: number
|
||||
updatedAt?: string
|
||||
categories: string[]
|
||||
countries: string[]
|
||||
}
|
||||
@@ -182,6 +183,7 @@ export function normalizeOphimMovie(movie: any, pathImage = OPHIM_IMAGE): Normal
|
||||
lang: text(movie?.lang),
|
||||
type: text(movie?.type),
|
||||
rating: Number(movie?.tmdb?.vote_average || movie?.imdb?.vote_average) || undefined,
|
||||
updatedAt: text(movie?.modified?.time || movie?.created),
|
||||
categories: toArray(movie?.category).map((item: any) => text(item?.name)).filter(Boolean),
|
||||
countries: toArray(movie?.country).map((item: any) => text(item?.name)).filter(Boolean),
|
||||
}
|
||||
@@ -203,6 +205,7 @@ export function normalizeKkphimMovie(movie: any, pathImage = KKPHIM_IMAGE): Norm
|
||||
lang: text(movie?.lang),
|
||||
type: text(movie?.type),
|
||||
rating: Number(movie?.tmdb?.vote_average || movie?.imdb?.vote_average) || undefined,
|
||||
updatedAt: text(movie?.modified?.time || movie?.created),
|
||||
categories: toArray(movie?.category).map((item: any) => text(item?.name)).filter(Boolean),
|
||||
countries: toArray(movie?.country).map((item: any) => text(item?.name)).filter(Boolean),
|
||||
}
|
||||
@@ -226,6 +229,7 @@ function normalizeNguoncMovie(movie: any): NormalizedMovie {
|
||||
lang: text(movie?.language || movie?.lang),
|
||||
type: text(movie?.type),
|
||||
rating: Number(movie?.rating) || undefined,
|
||||
updatedAt: text(movie?.modified || movie?.created),
|
||||
categories: toArray(movie?.category || movie?.categories).map((item: any) => text(item?.name ?? item)).filter(Boolean),
|
||||
countries: toArray(movie?.country || movie?.countries).map((item: any) => text(item?.name ?? item)).filter(Boolean),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user