import { useTranslation } from 'components/hooks/useTranslation' import { Preview } from './types' type Props = { slug: string previews: Array | [] } export function RestPreviewNotice({ slug, previews }: Props) { const { t } = useTranslation('products') const previewNotices = previews.map((preview, index) => { return (
{preview.required && t('preview_header_is_required')}
) }) return ( <>

{previews.length > 1 ? `${t('rest.reference.preview_notices')}` : `${t('rest.reference.preview_notice')}`}

{previewNotices} ) }