feat: url scraper to recipe

This commit is contained in:
2025-01-18 00:46:05 +01:00
parent 6112d007c2
commit d4cccacc28
24 changed files with 1349 additions and 137 deletions

View File

@ -1,22 +1,22 @@
import { ComponentChildren } from "preact";
import Search from "@islands/Search.tsx";
import { GenericResource, SearchResult } from "@lib/types.ts";
import { GenericResource } from "@lib/types.ts";
export type Props = {
children: ComponentChildren;
title?: string;
name?: string;
url: URL;
url: URL | string;
description?: string;
context?: { type: string };
searchResults?: GenericResource[];
};
export const MainLayout = (
{ children, url, title, context, searchResults }: Props,
{ children, url, context, searchResults }: Props,
) => {
const _url = typeof url === "string" ? new URL(url) : url;
const hasSearch = _url.search.includes("q=");
const hasSearch = _url?.search?.includes("q=");
if (hasSearch) {
return (