'use client' import {useContext, useState} from 'react' import Wrap from '@/components/wrap' import Image from 'next/image' import anno from '@/assets/header/product/anno.svg' import {Domestic, Oversea, Tab} from '@/app/(root)/@header/_server/product' import Link from 'next/link' import {merge} from '@/lib/utils' import {HeaderContext} from '@/app/(root)/@header/page' type TabType = 'domestic' | 'oversea' export default function ProductMenu() { const [type, setType] = useState('domestic') return (
{type === 'domestic' ? ( ) : ( ) }
) } export function DomesticLink(props: { label: string desc: string href: string discount: number }) { const ctx = useContext(HeaderContext) if (!ctx) { throw new Error(`HeaderContext not found`) } const onClick = () => { ctx.setMenu(false) } return (

{props.label} 折扣{props.discount}%

{props.desc}

) }