fix: soo many lint errors
This commit is contained in:
@@ -13,13 +13,16 @@ import { MetaTags } from "@components/MetaTags.tsx";
|
||||
import { fetchResource } from "@lib/marka/index.ts";
|
||||
import { RecipeResource } from "@lib/marka/schema.ts";
|
||||
import { parseIngredients } from "@lib/parseIngredient.ts";
|
||||
import { parseRating } from "@lib/helpers.ts";
|
||||
|
||||
export const handler: Handlers<
|
||||
{ recipe: RecipeResource; session: unknown } | null
|
||||
> = {
|
||||
async GET(_, ctx) {
|
||||
try {
|
||||
const recipe = await fetchResource(`recipes/${ctx.params.name}.md`);
|
||||
const recipe = await fetchResource<RecipeResource>(
|
||||
`recipes/${ctx.params.name}.md`,
|
||||
);
|
||||
if (!recipe) {
|
||||
return ctx.renderNotFound();
|
||||
}
|
||||
@@ -59,6 +62,7 @@ function ValidRecipe({
|
||||
.map((instruction) => {
|
||||
return (
|
||||
<li
|
||||
// deno-lint-ignore react-no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: renderMarkdown(instruction),
|
||||
}}
|
||||
@@ -72,17 +76,20 @@ function ValidRecipe({
|
||||
}
|
||||
|
||||
export default function Page(
|
||||
props: PageProps<{ recipe: Recipe; session: Record<string, string> }>,
|
||||
props: PageProps<{ recipe: RecipeResource; session: Record<string, string> }>,
|
||||
) {
|
||||
const { recipe, session } = props.data;
|
||||
|
||||
const portion = recipe.recipeYield;
|
||||
const portion = recipe.content.recipeYield;
|
||||
const amount = useSignal(portion || 1);
|
||||
|
||||
const subline = [
|
||||
recipe?.content?.prepTime && `Duration ${recipe?.content?.prepTime}`,
|
||||
recipe?.content?.totalTime && `Duration ${recipe?.content?.totalTime}`,
|
||||
].filter(Boolean) as string[];
|
||||
|
||||
const rating = recipe.content.reviewRating?.ratingValue &&
|
||||
parseRating(recipe.content.reviewRating.ratingValue);
|
||||
|
||||
return (
|
||||
<MainLayout
|
||||
url={props.url}
|
||||
@@ -106,13 +113,13 @@ export default function Page(
|
||||
)}
|
||||
</PageHero.Header>
|
||||
<PageHero.Footer>
|
||||
<PageHero.Title link={recipe.content?.link}>
|
||||
<PageHero.Title link={recipe.content?.url}>
|
||||
{recipe.content.name}
|
||||
</PageHero.Title>
|
||||
<PageHero.Subline
|
||||
entries={subline}
|
||||
>
|
||||
{recipe.meta?.rating && <Star rating={recipe.meta?.rating} />}
|
||||
{rating && <Star rating={rating} />}
|
||||
</PageHero.Subline>
|
||||
</PageHero.Footer>
|
||||
</PageHero>
|
||||
|
||||
Reference in New Issue
Block a user