import { FormButtons } from '@components/admin/FormButtons.js'; import Area from '@components/common/Area.js'; import { Form } from '@components/common/form/Form.js'; import { toast } from '@components/common/ui/Sonner.js'; import { _ } from '@evershop/evershop/lib/locale/translate/_'; import React from 'react'; interface BlogPostNewFormProps { action: string; gridUrl: string; } export default function BlogPostNewForm({ action, gridUrl }: BlogPostNewFormProps) { return (
{ toast.success(_('Post created successfully!')); setTimeout(() => { const editUrl = response.data.links.find( (link) => link.rel === 'edit' ).href; window.location.href = editUrl; }, 1500); }} id="blogPostNewForm" submitBtn={false} >
); } export const layout = { areaId: 'content', sortOrder: 10 }; export const query = ` query Query { action: url(routeId: "createBlogPost") gridUrl: url(routeId: "blogPostGrid") } `;