'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React from 'react';
import { ExternalLinkIcon } from '../../icons/ExternalLink/index.js';
import './index.scss';
import { usePreviewURL } from '../../providers/LivePreview/context.js';
import { useTranslation } from '../../providers/Translation/index.js';
const baseClass = 'preview-btn';
export function PreviewButton(props) {
    const { previewURL } = usePreviewURL();
    const { t } = useTranslation();
    if (!previewURL) {
        return null;
    }
    return /*#__PURE__*/ _jsxDEV("a", {
        "aria-label": t('version:preview'),
        className: baseClass,
        href: previewURL,
        id: "preview-button",
        target: "_blank",
        title: t('version:preview'),
        children: /*#__PURE__*/ _jsxDEV(ExternalLinkIcon, {}, void 0, false, {
            fileName: "src/elements/PreviewButton/index.tsx",
            lineNumber: 30,
            columnNumber: 7
        }, this)
    }, void 0, false, {
        fileName: "src/elements/PreviewButton/index.tsx",
        lineNumber: 22,
        columnNumber: 5
    }, this);
}

//# sourceMappingURL=index.js.map