import { useEffect } from 'react';
import { Dialog } from '@elementor/app-ui';
import { Context as TemplatesContext } from '../context/templates';
export default function DialogRename( props ) {
const { findTemplateItemInState, updateTemplate } = React.useContext( TemplatesContext ),
template = findTemplateItemInState( props.id );
const [ title, setTitle ] = React.useState( '' );
useEffect( () => {
// The "title" state should be updated if the template title changed.
if ( template ) {
setTitle( template.title );
}
}, [ template ] );
const closeDialog = ( shouldUpdate ) => {
props.setId( null );
if ( shouldUpdate ) {
updateTemplate( props.id, { post_title: title } );
}
};
if ( ! props.id ) {
return '';
}
return (
);
}
DialogRename.propTypes = {
id: PropTypes.number,
setId: PropTypes.func.isRequired,
};
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 62
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/permalink-manager/includes/views/permalink-manager-uri-editor-post.php:1) in /home/u651917044/domains/realityflooring.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/abstract-xml.php on line 65 https://realityflooring.com/post-sitemap.xml2025-05-20T07:23:33+00:00https://realityflooring.com/page-sitemap.xml2023-10-16T07:02:06+00:00https://realityflooring.com/service_list-sitemap.xml2023-10-19T07:06:25+00:00https://realityflooring.com/category-sitemap.xml2025-05-20T07:23:33+00:00