Vercel/src/recipe/RecipeOGTile.tsx
Sam Becker d2e62a9091
Improve tooltip segues (#272)
* Update GH issue template

* Create custom tooltip display engine

* Fix tooltip cleanup behavior

* Make tooltip position size-aware

* Refine tooltip og positioning

* Refine og tooltip behavior

* Refine og image loading behavior
2025-06-22 15:03:18 -05:00

36 lines
868 B
TypeScript

import { Photo, PhotoDateRange } from '@/photo';
import { pathForRecipe, pathForRecipeImage } from '@/app/paths';
import OGTile, { OGTilePropsCore } from '@/components/og/OGTile';
import { descriptionForRecipePhotos, titleForRecipe } from '.';
import { useAppText } from '@/i18n/state/client';
export default function RecipeOGTile({
recipe,
photos,
count,
dateRange,
...props
}: {
recipe: string
photos: Photo[]
count?: number
dateRange?: PhotoDateRange
} & OGTilePropsCore) {
const appText = useAppText();
return (
<OGTile {...{
...props,
title: titleForRecipe(recipe, photos, appText, count),
description: descriptionForRecipePhotos(
photos,
appText,
true,
count,
dateRange,
),
path: pathForRecipe(recipe),
pathImage: pathForRecipeImage(recipe),
}}/>
);
};