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 WebScrapeToolView({ 
  name = "scrape-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}
          Scraping webpage...
Fetching content from {domain}
                      {webpageContent.text || "No content extracted"}
                    
                  No content extracted
The webpage might be restricted or empty