"use client";
import React from "react";
import { Badge } from "@/components/ui/badge";
import {
Link as LinkIcon,
Type,
Image as ImageIcon,
User,
Building,
Calendar,
HelpCircle,
Hash,
Text,
} from "lucide-react";
const keyMappings: { [key: string]: string } = {
"@type": "Type",
"@context": "Context",
"@id": "ID",
name: "Name",
headline: "Headline",
description: "Description",
author: "Author",
publisher: "Publisher",
mainEntityOfPage: "Main Page",
image: "Image",
datePublished: "Date Published",
dateModified: "Date Modified",
acceptedAnswer: "Answer",
mainEntity: "Main Content",
url: "URL",
text: "Text",
question: "Question",
answer: "Answer",
logo: "Logo",
telephone: "Telephone",
email: "Email",
};
const keyIcons: { [key: string]: React.ElementType } = {
"@type": Type,
"@id": Hash,
url: LinkIcon,
image: ImageIcon,
logo: ImageIcon,
author: User,
publisher: Building,
datePublished: Calendar,
dateModified: Calendar,
question: HelpCircle,
text: Text,
};
const renderValue = (value: any, level: number): React.ReactNode => {
if (typeof value === "string") {
if (value.startsWith("http://") || value.startsWith("https://")) {
try {
const url = new URL(value);
return (
{item.name}
{item.acceptedAnswer.text}