2020-03-19 00:39:37 +01:00
|
|
|
import Container from './container'
|
|
|
|
import cn from 'classnames'
|
|
|
|
import { EXAMPLE_PATH } from '../lib/constants'
|
|
|
|
|
|
|
|
export default function Alert({ preview }) {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={cn('border-b', {
|
|
|
|
'bg-accent-7 border-accent-7 text-white': preview,
|
|
|
|
'bg-accent-1 border-accent-2': !preview,
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<Container>
|
|
|
|
<div className="py-2 text-center text-sm">
|
|
|
|
{preview ? (
|
|
|
|
<>
|
|
|
|
This page is a preview.{' '}
|
|
|
|
<a
|
|
|
|
href="/api/exit-preview"
|
|
|
|
className="underline hover:text-cyan duration-200 transition-colors"
|
|
|
|
>
|
|
|
|
Click here
|
|
|
|
</a>{' '}
|
|
|
|
to exit preview mode.
|
|
|
|
</>
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
The source code for this blog is{' '}
|
|
|
|
<a
|
2020-05-27 23:51:11 +02:00
|
|
|
href={`https://github.com/vercel/next.js/tree/canary/examples/${EXAMPLE_PATH}`}
|
2020-03-19 00:39:37 +01:00
|
|
|
className="underline hover:text-success duration-200 transition-colors"
|
|
|
|
>
|
|
|
|
available on GitHub
|
|
|
|
</a>
|
|
|
|
.
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</Container>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|