From 07bbb576f6476383fda3a96caa5f1e6640a1ee3b Mon Sep 17 00:00:00 2001 From: ner Date: Sat, 6 Jun 2026 23:08:32 +0300 Subject: [PATCH] perf: mark hero poster image as high fetch priority Lighthouse flagged the LCP carousel poster for missing fetchpriority=high. Adds a priority prop to Poster that emits the lowercase fetchpriority attribute (untyped in this @types/react version, so React forwards it through as a custom attribute) only on the eagerly-rendered hero image. Co-Authored-By: Claude Sonnet 4.6 --- .../(root)/components/Carousel/index.tsx | 4 +- components/Poster/index.tsx | 56 +++++++++++-------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/app/(site)/(root)/components/Carousel/index.tsx b/app/(site)/(root)/components/Carousel/index.tsx index 7729a79..31bce07 100644 --- a/app/(site)/(root)/components/Carousel/index.tsx +++ b/app/(site)/(root)/components/Carousel/index.tsx @@ -40,7 +40,9 @@ const Carousel = memo( return (
- {!loaded && } + {!loaded && ( + + )} void; className?: string; lazy?: boolean; + priority?: boolean; } -const Poster: FC = ({ show, onClick, className, lazy = true }) => ( -
- - - - - - {show.title} - - -
-); +type FetchPriorityProps = ImgHTMLAttributes & { fetchpriority?: 'high' | 'low' | 'auto' }; + +const Poster: FC = ({ show, onClick, className, lazy = true, priority = false }) => { + const fetchPriorityProps: FetchPriorityProps = priority ? { fetchpriority: 'high' } : {}; + + return ( +
+ + + + + + {show.title} + + +
+ ); +}; export default Poster;