68b29f6d8e
refactor(recipes): integrate Navigation component into various recipe pages
25 lines
708 B
TypeScript
25 lines
708 B
TypeScript
import { Metadata } from 'next';
|
|
import Navigation from '../Navigation';
|
|
import ImportTabsClient from './ImportTabsClient';
|
|
|
|
type Props = {
|
|
searchParams: Promise<{ tab?: string }>;
|
|
};
|
|
|
|
export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
|
|
const { tab } = await searchParams;
|
|
if (tab === 'recept') return { title: 'Importera recept' };
|
|
return { title: 'Importera kvitto' };
|
|
}
|
|
|
|
export default async function ImportPage({ searchParams }: Props) {
|
|
const { tab } = await searchParams;
|
|
const activeTab = tab === 'recept' ? 'recept' : 'kvitto';
|
|
return (
|
|
<>
|
|
<Navigation />
|
|
<ImportTabsClient activeTab={activeTab} />
|
|
</>
|
|
);
|
|
}
|