fix: soo many lint errors

This commit is contained in:
Max Richter
2025-11-03 00:03:27 +01:00
parent c13420c3ab
commit 696082250d
41 changed files with 373 additions and 500 deletions

View File

@@ -1,6 +1,6 @@
import { PageProps, RouteContext } from "$fresh/server.ts";
import { MainLayout } from "@components/layouts/main.tsx";
import { ReviewResource, ReviewSchema } from "@lib/marka/schema.ts";
import { ReviewResource } from "@lib/marka/schema.ts";
import { removeImage, renderMarkdown } from "@lib/markdown.ts";
import { KMenu } from "@islands/KMenu.tsx";
import { RedirectSearchHandler } from "@islands/Search.tsx";
@@ -24,12 +24,16 @@ export default async function Greet(
return ctx.renderNotFound();
}
const { author = "", datePublished = "", reviewBody } = movie.content;
const { author, datePublished, reviewBody = "", reviewRating } =
movie.content;
const content = renderMarkdown(
removeImage(reviewBody || "", movie.content.image),
removeImage(reviewBody, movie.content.image),
);
const rating = reviewRating?.ratingValue &&
parseRating(reviewRating.ratingValue);
return (
<MainLayout url={props.url} title={`Movie > ${movie.name}`} context={movie}>
<RedirectSearchHandler />
@@ -53,37 +57,33 @@ export default async function Greet(
</PageHero.Title>
<PageHero.Subline
entries={[
author && {
title: author?.name,
author?.name &&
{
title: author.name,
href: `/?q=${encodeURIComponent(author?.name)}`,
},
datePublished.toString(),
datePublished?.toString(),
]}
>
{movie.content.reviewRating && (
<Star
rating={parseRating(movie.content?.reviewRating?.ratingValue)}
/>
)}
{rating && <Star rating={rating} />}
</PageHero.Subline>
</PageHero.Footer>
</PageHero>
{false && (
{movie.name && (
<Recommendations
id={movie.id}
id={movie.name}
type="movie"
/>
)}
<div class="px-8 text-white mt-10">
{movie?.content?.reviewBody?.length > 80
? <h2 class="text-4xl font-bold mb-4">Review</h2>
: <></>}
{reviewBody?.length > 80 && (
<h2 class="text-4xl font-bold mb-4">Review</h2>
)}
<pre
class="whitespace-break-spaces"
// deno-lint-ignore react-no-danger
dangerouslySetInnerHTML={{ __html: content || "" }}
>
{content}
</pre>
/>
</div>
</MainLayout>
);