fix: soo many lint errors
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user