All files / apps/web/src/backoffice/pages CrawlerEdit.jsx

0% Statements 0/111
0% Branches 0/126
0% Functions 0/52
0% Lines 0/102

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
import { useState, useEffect } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { 
  ArrowLeft, 
  Bug, 
  Save,
  Trash2,
  Settings,
  Play,
  Route,
  Brain,
  Clock
} from 'lucide-react';
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import api from '../../services/api';
import toast from 'react-hot-toast';
import { useOrganizationStore } from '../../store/organizationStore';
import ModelSelector from '../../components/ModelSelector';
import ScheduleSection from '../components/ScheduleSection';
import EntitySidebar from '../../components/EntitySidebar';
import BackofficeEntityPage from '../components/BackofficeEntityPage';
 
export default function CrawlerEdit() {
  const navigate = useNavigate();
  const { id } = useParams();
  const { currentOrganization } = useOrganizationStore();
  const organizationId = currentOrganization?.id;
  const queryClient = useQueryClient();
  const isNew = id === 'new';
 
  const [formData, setFormData] = useState({
    name: '',
    description: '',
    prompt: '',
    extractPrompt: '',
    samePrompt: true,
    startUrl: '',
    config: {
      maxPages: 10,
      maxDepth: 3,
      pageThreshold: 60,
      linkThreshold: 40,
      crawlDelay: 100,
      router: [],
      sameDomain: false,
      llmModel: 'deepseek/deepseek-v4-flash',
    }
  });
 
  const [showLaunchModal, setShowLaunchModal] = useState(false);
  const [routerMode, setRouterMode] = useState('existing');
  const [newKbName, setNewKbName] = useState('');
  const [newKbDescription, setNewKbDescription] = useState('');
 
  const { data: crawler, isLoading } = useQuery({
    queryKey: ['crawler', id],
    queryFn: async () => {
      if (isNew) return null;
      const response = await api.get(`/crawlers/${id}`);
      return response.data.data;
    },
    enabled: !isNew
  });
 
  const { data: crawlersList, isLoading: crawlersListLoading } = useQuery({
    queryKey: ['crawlers', organizationId],
    queryFn: async () => {
      const response = await api.get('/crawlers');
      return response.data.data || [];
    }
  });
 
  // Fetch available routers for selection
  const { data: routersData } = useQuery({
    queryKey: ['routers'],
    queryFn: async () => {
      const response = await api.get('/knowledge-routers');
      return response.data.data || [];
    }
  });
 
  useEffect(() => {
    if (crawler) {
      setFormData({
        name: crawler.name || '',
        description: crawler.description || '',
        prompt: crawler.prompt || '',
        extractPrompt: crawler.extractPrompt || '',
        samePrompt: !crawler.extractPrompt,
        startUrl: crawler.startUrl || '',
        config: {
           maxPages: crawler.config?.maxPages || 10,
          maxDepth: crawler.config?.maxDepth || 3,
          pageThreshold: crawler.config?.pageThreshold || 60,
          linkThreshold: crawler.config?.linkThreshold || 40,
          crawlDelay: crawler.config?.crawlDelay || 100,
          router: crawler.config?.router || [],
          sameDomain: crawler.config?.sameDomain || false,
          llmModel: crawler.config?.llmModel || 'deepseek/deepseek-v4-flash',
        }
      });
    }
  }, [crawler]);
 
  const saveCrawler = useMutation({
    mutationFn: async (data) => {
      const payload = { ...data, organizationId, extractPrompt: data.samePrompt ? '' : (data.extractPrompt || '') };
      delete payload.samePrompt;
      if (isNew && routerMode === 'create') {
        delete payload.config.router;
        payload.createKb = { name: newKbName, description: newKbDescription };
        return api.post('/crawlers', payload);
      }
      if (isNew) {
        return api.post('/crawlers', payload);
      } else {
        return api.put(`/crawlers/${id}`, payload);
      }
    },
    onSuccess: () => {
      toast.success(isNew ? 'Crawler créé' : 'Crawler mis à jour');
      queryClient.invalidateQueries(['crawlers']);
      if (isNew) {
        setTimeout(() => {
          navigate(`/${organizationId}/backoffice/crawlers`, { replace: true });
        }, 0);
      }
    },
    onError: (error) => {
      toast.error(error.response?.data?.message || 'Erreur lors de la sauvegarde');
    }
  });
 
  const deleteCrawler = useMutation({
    mutationFn: async () => {
      return api.delete(`/crawlers/${id}`);
    },
    onSuccess: () => {
      toast.success('Crawler supprimé');
      queryClient.invalidateQueries(['crawlers']);
      navigate(`/${organizationId}/backoffice/crawlers`);
    },
    onError: (error) => {
      toast.error(error.response?.data?.message || 'Erreur lors de la suppression');
    }
  });
 
  const [launchUrl, setLaunchUrl] = useState('');
 
  const startJob = useMutation({
    mutationFn: async ({ url }) => {
      return api.post(`/crawlers/${id}/start`, { startUrl: url });
    },
    onSuccess: () => {
      toast.success('Job de crawl démarré');
      setShowLaunchModal(false);
      navigate(`/${organizationId}/backoffice/jobs`);
    },
    onError: (error) => {
      toast.error(error.response?.data?.message || 'Erreur lors du démarrage');
    }
  });
 
  const handleLaunch = () => {
    if (formData.startUrl) {
      startJob.mutate({ url: formData.startUrl });
    } else {
      setLaunchUrl('');
      setShowLaunchModal(true);
    }
  };
 
  const handleConfigChange = (field, value) => {
    setFormData(prev => ({
      ...prev,
      config: {
        ...prev.config,
        [field]: value
      }
    }));
  };
 
  const handleSubmit = (e) => {
    e.preventDefault();
    if (routerMode === 'existing' && (!formData.config.router || formData.config.router.length === 0)) {
      toast.error('Veuillez sélectionner un router de destination');
      return;
    }
    if (routerMode === 'create' && !newKbName.trim()) {
      toast.error('Veuillez saisir un nom pour la base de connaissances');
      return;
    }
    saveCrawler.mutate(formData);
  };
 
  const sidebar = (
    <EntitySidebar
      items={crawlersList || []}
      selectedId={isNew ? null : id}
      getItemHref={(c) => `/${organizationId}/backoffice/crawlers/${c._id || c.id}`}
      searchPlaceholder="Rechercher un crawler..."
      emptyMessage="Aucun crawler disponible"
      title="Crawlers"
      icon={Bug}
      iconClass="text-indigo-600"
      backofficeTo={`/${organizationId}/backoffice/crawlers/new`}
      backofficeManageLabel="Créer un crawler"
      backofficeCreateLabel="Créer un crawler"
      createOnly
      loading={crawlersListLoading}
      filterFn={(c) => `${c.name} ${c.description || ''}`}
      renderItem={(c, isSelected) => (
        <>
          <div className="flex items-center">
            <Bug className={`w-4 h-4 mr-2 flex-shrink-0 ${isSelected ? 'text-indigo-600' : 'text-gray-400'}`} />
            <span className={`text-sm font-medium truncate flex-1 ${isSelected ? 'text-gray-900' : 'text-gray-700'}`}>
              {c.name}
            </span>
          </div>
          {c.description && (
            <div className="text-xs text-gray-500 truncate mt-0.5">{c.description}</div>
          )}
        </>
      )}
    />
  );
 
  return (
    <BackofficeEntityPage selectedId={isNew ? null : id} sidebar={sidebar}>
      <div className="flex-1 min-h-0 overflow-y-auto p-3 sm:p-6">
        <div className="space-y-6">
      <div className="flex justify-end gap-2">
        {!isNew && (
          <>
            <button
              onClick={handleLaunch}
              className="flex items-center px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700"
            >
              <Play className="w-5 h-5 mr-2" />
              Lancer
            </button>
            <button
              onClick={() => {
                if (confirm('Êtes-vous sûr de vouloir supprimer ce crawler ?')) {
                  deleteCrawler.mutate();
                }
              }}
              className="flex items-center px-4 py-2 text-red-600 border border-red-300 rounded-lg hover:bg-red-50"
            >
              <Trash2 className="w-5 h-5 mr-2" />
              Supprimer
            </button>
          </>
        )}
        <button
          onClick={handleSubmit}
          disabled={saveCrawler.isLoading}
          className="flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 disabled:opacity-50"
        >
          <Save className="w-5 h-5 mr-2" />
          {saveCrawler.isLoading ? 'Sauvegarde...' : 'Sauvegarder'}
        </button>
      </div>
 
      <form onSubmit={handleSubmit} className="space-y-6">
        {/* General Info */}
        <div className="bg-white rounded-lg shadow p-6">
          <div className="flex items-center mb-4">
            <Bug className="w-6 h-6 text-indigo-600 mr-2" />
            <h3 className="text-lg font-medium text-gray-900">Informations générales</h3>
          </div>
          
          <div className="space-y-4">
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Nom du crawler *
              </label>
              <input
                type="text"
                value={formData.name}
                onChange={(e) => setFormData(prev => ({ ...prev, name: e.target.value }))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                placeholder="Ex: Crawler Documentation IA"
                required
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Description
              </label>
              <input
                type="text"
                value={formData.description}
                onChange={(e) => setFormData(prev => ({ ...prev, description: e.target.value }))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                placeholder="Description courte du crawler..."
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                URL de départ *
              </label>
              <input
                type="url"
                value={formData.startUrl}
                onChange={(e) => setFormData(prev => ({ ...prev, startUrl: e.target.value }))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                placeholder="https://example.com"
                required
              />
              <div className="flex items-center justify-between mt-2">
                <div className="flex flex-col">
                  <span className="text-sm font-medium text-gray-700">Même domaine uniquement</span>
                  <span className="text-xs text-gray-500">Ne pas explorer les liens externes</span>
                </div>
                <button
                  type="button"
                  onClick={() => handleConfigChange('sameDomain', !formData.config.sameDomain)}
                  className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${formData.config.sameDomain ? 'bg-indigo-600' : 'bg-gray-300'}`}
                >
                  <span className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${formData.config.sameDomain ? 'translate-x-6' : 'translate-x-1'}`} />
                </button>
              </div>
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Prompt de pertinence
              </label>
              <textarea
                value={formData.prompt}
                onChange={(e) => setFormData(prev => ({ ...prev, prompt: e.target.value }))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                placeholder="Instructions pour évaluer si une page est pertinente..."
                rows={4}
              />
              <p className="text-xs text-gray-500 mt-1">
                Détermine quelles pages et liens sont pertinents à crawler
              </p>
            </div>
            <div className="flex items-center justify-between bg-gray-50 rounded-lg px-4 py-3 mt-4">
              <div className="flex items-center gap-2">
                <span className="text-sm font-medium text-gray-700">Prompt d'extraction de faits</span>
                <span className={`text-xs px-2 py-0.5 rounded-full ${!formData.samePrompt ? 'bg-green-100 text-green-700' : 'bg-gray-200 text-gray-500'}`}>
                  {!formData.samePrompt ? 'Personnalisé' : 'Identique au prompt de crawl'}
                </span>
              </div>
              <button
                type="button"
                onClick={() => setFormData(prev => ({ ...prev, samePrompt: !prev.samePrompt }))}
                className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${formData.samePrompt ? 'bg-indigo-600' : 'bg-gray-300'}`}
              >
                <span className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${formData.samePrompt ? 'translate-x-6' : 'translate-x-1'}`} />
              </button>
            </div>
            {!formData.samePrompt && (
              <div className="mt-2">
                <textarea
                  value={formData.extractPrompt}
                  onChange={(e) => setFormData(prev => ({ ...prev, extractPrompt: e.target.value }))}
                  className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                  placeholder="Instructions spécifiques pour l'extraction des faits..."
                  rows={4}
                />
                <p className="text-xs text-gray-500 mt-1">
                  Sera utilisé pour extraire les faits du contenu des pages pertinentes
                </p>
              </div>
            )}
          </div>
        </div>
 
        {/* Crawling Limits */}
        <div className="bg-white rounded-lg shadow p-6">
          <div className="flex items-center mb-4">
            <Settings className="w-6 h-6 text-indigo-600 mr-2" />
            <h3 className="text-lg font-medium text-gray-900">Limites du crawl</h3>
          </div>
          
          <div className="grid grid-cols-1 md:grid-cols-5 gap-4">
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Max pages
              </label>
              <input
                type="number"
                value={formData.config.maxPages}
                onChange={(e) => handleConfigChange('maxPages', parseInt(e.target.value))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                min={1}
                max={10000}
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Profondeur max
              </label>
              <input
                type="number"
                value={formData.config.maxDepth}
                onChange={(e) => handleConfigChange('maxDepth', parseInt(e.target.value))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                min={1}
                max={10}
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Page threshold (%)
              </label>
              <input
                type="number"
                value={formData.config.pageThreshold}
                onChange={(e) => handleConfigChange('pageThreshold', parseInt(e.target.value))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                min={0}
                max={100}
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Link threshold (%)
              </label>
              <input
                type="number"
                value={formData.config.linkThreshold}
                onChange={(e) => handleConfigChange('linkThreshold', parseInt(e.target.value))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                min={0}
                max={100}
              />
            </div>
            <div>
              <label className="block text-sm font-medium text-gray-700 mb-1">
                Crawl Delay (ms)
              </label>
              <input
                type="number"
                value={formData.config.crawlDelay}
                onChange={(e) => handleConfigChange('crawlDelay', parseInt(e.target.value))}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                min={100}
                max={60000}
              />
            </div>
        </div>
 
        {/* LLM Model Selection */}
        <div className="mt-6 pt-6 border-t border-gray-200">
          <div className="flex items-center mb-4">
            <Brain className="w-5 h-5 text-indigo-600 mr-2" />
            <h4 className="text-sm font-medium text-gray-900">Modèle LLM</h4>
          </div>
          <ModelSelector
            value={formData.config.llmModel}
            onChange={(val) => handleConfigChange('llmModel', val)}
          />
          <p className="text-xs text-gray-500 mt-1">
            Modèle utilisé pour l'évaluation des pages et des liens
          </p>
        </div>
      </div>
 
      {/* Router Configuration */}
        <div className="bg-white rounded-lg shadow p-6">
          <div className="flex items-center mb-4">
            <Route className="w-6 h-6 text-indigo-600 mr-2" />
            <h3 className="text-lg font-medium text-gray-900">Router de destination</h3>
          </div>
 
          <div className="flex space-x-4 mb-4">
            <label className="flex items-center">
              <input
                type="radio"
                name="routerMode"
                value="existing"
                checked={routerMode === 'existing'}
                onChange={() => setRouterMode('existing')}
                className="mr-2"
                disabled={!isNew}
              />
              <span className="text-sm text-gray-700">Utiliser un router existant</span>
            </label>
            <label className="flex items-center">
              <input
                type="radio"
                name="routerMode"
                value="create"
                checked={routerMode === 'create'}
                onChange={() => { setRouterMode('create'); setNewKbName(formData.name); }}
                className="mr-2"
                disabled={!isNew}
              />
              <span className="text-sm text-gray-700">Créer un nouveau router + base de connaissances</span>
            </label>
          </div>
 
          {routerMode === 'existing' ? (
            <>
              <p className="text-sm text-gray-600 mb-4">
                Sélectionnez la base de connaissances qui recevra les faits extraits par ce crawler.
              </p>
              <select
                value={formData.config.router?.[0]?.id || ''}
                onChange={(e) => {
                  if (e.target.value) {
                    handleConfigChange('router', [{ type: 'meilisearch', id: e.target.value }]);
                  } else {
                    handleConfigChange('router', []);
                  }
                }}
                className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                required={routerMode === 'existing'}
              >
                <option value="">Sélectionnez un router...</option>
                {routersData?.map((router) => (
                  <option key={router._id || router.id} value={router._id || router.id}>
                    {router.name} {router.description ? `- ${router.description}` : ''}
                  </option>
                ))}
              </select>
              {formData.config.router && formData.config.router.length > 0 && (
                <div className="mt-4 p-3 bg-indigo-50 rounded-lg">
                  <p className="text-sm text-indigo-700">
                    Router sélectionné: <strong>{routersData?.find(r => r._id === formData.config.router[0].id)?.name || formData.config.router[0].id}</strong>
                  </p>
                </div>
              )}
            </>
          ) : (
            <div className="space-y-4">
              <p className="text-sm text-gray-600">
                Un nouveau router et une nouvelle base de connaissances seront créés automatiquement.
              </p>
              <div>
                <label className="block text-sm font-medium text-gray-700 mb-1">
                  Nom de la base de connaissances *
                </label>
                <input
                  type="text"
                  value={newKbName}
                  onChange={(e) => setNewKbName(e.target.value)}
                  className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                  placeholder="Ex: Documentation IA"
                  required={routerMode === 'create'}
                />
              </div>
              <div>
                <label className="block text-sm font-medium text-gray-700 mb-1">
                  Description
                </label>
                <input
                  type="text"
                  value={newKbDescription}
                  onChange={(e) => setNewKbDescription(e.target.value)}
                  className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500"
                  placeholder="Description optionnelle..."
                />
              </div>
              <p className="text-xs text-gray-500">
                Le router sera créé avec le même nom et pointera vers cette base de connaissances.
              </p>
            </div>
          )}
        </div>
 
        {/* Schedule Configuration */}
        <ScheduleSection
          crawlerId={id === 'new' ? null : id}
          organizationId={organizationId}
          disabled={isNew}
        />
      </form>
 
      {showLaunchModal && (
        <div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
          <div className="bg-white rounded-lg p-6 w-full max-w-md">
            <h3 className="text-lg font-medium text-gray-900 mb-4">Lancer un crawl</h3>
            <p className="text-sm text-gray-600 mb-4">
              Entrez l'URL de départ pour ce crawler
            </p>
            <input
              type="url"
              value={launchUrl}
              onChange={(e) => setLaunchUrl(e.target.value)}
              placeholder="https://example.com"
              className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 mb-4"
            />
            <div className="flex justify-end space-x-4">
              <button
                onClick={() => {
                  setShowLaunchModal(false);
                  setLaunchUrl('');
                }}
                className="px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50"
              >
                Annuler
              </button>
              <button
                onClick={() => startJob.mutate({ url: launchUrl })}
                disabled={startJob.isLoading || !launchUrl.trim()}
                className="flex items-center px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 disabled:opacity-50"
              >
                <Play className="w-4 h-4 mr-2" />
                {startJob.isLoading ? 'Démarrage...' : 'Démarrer'}
              </button>
            </div>
          </div>
        </div>
      )}
        </div>
      </div>
    </BackofficeEntityPage>
  );
}