import React from "react";
import { Globe, CheckCircle, AlertTriangle, CircleDashed, ExternalLink } from "lucide-react";
import { ToolViewProps } from "./types";
import { extractCrawlUrl, extractWebpageContent, formatTimestamp, getToolTitle } from "./utils";
import { GenericToolView } from "./GenericToolView";
import { cn } from "@/lib/utils";
export function WebCrawlToolView({
name = "crawl-webpage",
assistantContent,
toolContent,
assistantTimestamp,
toolTimestamp,
isSuccess = true,
isStreaming = false
}: ToolViewProps) {
const url = extractCrawlUrl(assistantContent);
const webpageContent = extractWebpageContent(toolContent);
const toolTitle = getToolTitle(name);
if (!url) {
return (
{url}
Crawling webpage...
Fetching content from {domain}
{webpageContent.text || "No content extracted"}
No content extracted
The webpage might be restricted or empty