import type { ThirdwebClient } from "../../../../../client/client.js"; import { resolveScheme } from "../../../../../utils/ipfs.js"; import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js"; import { radius, spacing } from "../../../../core/design-system/index.js"; import { Container } from "../../components/basic.js"; import { Spacer } from "../../components/Spacer.js"; import { Text } from "../../components/text.js"; export function WithHeader(props: { children: React.ReactNode; title: string | undefined; description: string | undefined; image: string | undefined; client: ThirdwebClient; }) { const theme = useCustomTheme(); return ( {/* image */} {props.image && (
)} {(props.title || props.description) && ( <> {/* title */} {props.title && ( {props.title} )} {/* Description */} {props.description && ( <> {props.description} )} )} {props.children} ); } function getUrl(client: ThirdwebClient, uri: string) { if (!uri.startsWith("ipfs://")) { return uri; } return resolveScheme({ client, uri, }); }