feat: url scraper to recipe
This commit is contained in:
@ -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 (
|
||||
|
Reference in New Issue
Block a user