/**
 * @fileoverview Página de Sitemap do projeto (software).
 * @route /projetos/[id]/software/seo/sitemap
 */

'use client';

import React from 'react';
import { useParams } from 'next/navigation';
import ProjetoLayout from '@/components/layouts/ProjetoLayout';
import { OperativeRouteHint } from '@/components/layouts/OperativeRouteHint/OperativeRouteHint';
import { withProjetosSoftwareParametrosHub } from '@/lib/routes/projetosParametrosPaths';
import { SitemapCrawlerScreen } from '@/features/sitemap-crawler/components/SitemapCrawlerScreen';

export default function SoftwareSeoSitemapPage() {
    const params = useParams();
    const id = params?.id as string;
    const projetoId = Number.parseInt(id, 10);

    return (
        <ProjetoLayout
            projetoId={id}
            pageTitle="Sitemap"
            pageIcon="sitemap"
            titleSection="SEO - Sitemap"
        >
            <OperativeRouteHint
                type="info"
                message="Indexação e cobertura"
                description={withProjetosSoftwareParametrosHub(
                    'Gere o sitemap a partir da URL pública do projeto. O crawl respeita robots.txt, ignora links externos e permite exportar o XML para validação no Search Console.',
                )}
            />
            <SitemapCrawlerScreen
                initialProjetoId={Number.isFinite(projetoId) ? projetoId : undefined}
                showProjetoSelect={false}
                testIdPrefix="projeto-sitemap"
            />
        </ProjetoLayout>
    );
}
