import { SearchSnippetPreview } from '@components/admin/SearchSnippetPreview.js';
import { InputField } from '@components/common/form/InputField.js';
import { TextareaField } from '@components/common/form/TextareaField.js';
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '@components/common/ui/Card.js';
import { _ } from '@evershop/evershop/lib/locale/translate/_';
import React from 'react';
import { useWatch } from 'react-hook-form';
interface BlogPostSeoProps {
post?: {
name?: string;
urlKey?: string;
metaTitle?: string;
metaDescription?: string;
};
}
function SnippetPreview({ name }: { name?: string }) {
const urlKey = useWatch({ name: 'url_key' });
const metaTitle = useWatch({ name: 'meta_title' });
const metaDescription = useWatch({ name: 'meta_description' });
return (
);
}
export default function Seo({ post }: BlogPostSeoProps) {
return (
{_('Search Engine Optimization')}
{_('URL key is auto-generated from the title if left blank.')}
);
}
export const layout = {
areaId: 'leftSide',
sortOrder: 20
};
export const query = `
query Query {
post: blogPost(id: getContextValue("blogPostUuid", null)) {
name
urlKey
metaTitle
metaDescription
}
}
`;