1
0
mirror of synced 2025-12-22 03:16:52 -05:00
Files
docs/components/rest/RestPreviewNotice.tsx
2022-04-11 16:09:03 +00:00

28 lines
752 B
TypeScript

import { useTranslation } from 'components/hooks/useTranslation'
type Props = {
slug: string
previews: Array<string>
}
export function RestPreviewNotice({ slug, previews }: Props) {
const { t } = useTranslation('products')
return (
<>
<h4 id={`${slug}-preview-notices`}>
{previews.length > 1
? `${t('rest.reference.preview_notices')}`
: `${t('rest.reference.preview_notice')}`}
</h4>
{previews.map((preview, index) => (
<div
className="extended-markdown note border rounded-1 mb-6 p-3 color-border-accent-emphasis color-bg-accent f5"
dangerouslySetInnerHTML={{ __html: preview }}
key={JSON.stringify(preview) + index}
/>
))}
</>
)
}