[dyad] Organized results into a tabbed view - wrote 3 file(s)
This commit is contained in:
@@ -16,10 +16,6 @@ interface FaqDisplayProps {
|
||||
|
||||
export function FaqDisplay({ faqs }: FaqDisplayProps) {
|
||||
return (
|
||||
<div>
|
||||
<h3 className="font-semibold text-card-foreground mb-2">
|
||||
FAQ Structured Data
|
||||
</h3>
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
{faqs.map((faq, index) => (
|
||||
<AccordionItem value={`item-${index}`} key={index}>
|
||||
@@ -28,6 +24,5 @@ export function FaqDisplay({ faqs }: FaqDisplayProps) {
|
||||
</AccordionItem>
|
||||
))}
|
||||
</Accordion>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Globe, Edit, Check, Loader2, X, ImageOff } from "lucide-react";
|
||||
import { extractMetaData, type HeadlineNode } from "@/app/actions";
|
||||
import { LengthIndicator } from "./length-indicator";
|
||||
@@ -13,6 +13,7 @@ import { SerpPreview } from "./serp-preview";
|
||||
import { ResultsSkeleton } from "./results-skeleton";
|
||||
import { FaqDisplay } from "./faq-display";
|
||||
import { HeadlineTree } from "./headline-tree";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
||||
interface MetaData {
|
||||
title: string;
|
||||
@@ -121,14 +122,20 @@ export function MetaForm() {
|
||||
)}
|
||||
|
||||
{!loading && metaData && (
|
||||
<div className="space-y-6">
|
||||
<Tabs defaultValue="analysis" className="w-full">
|
||||
<TabsList className="mb-4">
|
||||
<TabsTrigger value="analysis">Meta Analysis</TabsTrigger>
|
||||
{metaData.headlines && metaData.headlines.length > 0 && (
|
||||
<TabsTrigger value="headlines">Headlines</TabsTrigger>
|
||||
)}
|
||||
{metaData.faq && metaData.faq.length > 0 && (
|
||||
<TabsTrigger value="faq">FAQ</TabsTrigger>
|
||||
)}
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="analysis">
|
||||
<Card className="w-full shadow-lg rounded-lg">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-xl text-card-foreground">
|
||||
Meta Analysis
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CardContent className="p-6">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
@@ -141,7 +148,6 @@ export function MetaForm() {
|
||||
url={url}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{metaData.image && (
|
||||
<div>
|
||||
<h3 className="font-semibold text-card-foreground mb-2">
|
||||
@@ -164,10 +170,6 @@ export function MetaForm() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{metaData.faq && metaData.faq.length > 0 && (
|
||||
<FaqDisplay faqs={metaData.faq} />
|
||||
)}
|
||||
</div>
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
@@ -256,8 +258,8 @@ export function MetaForm() {
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground mt-1 mb-2">
|
||||
A brief summary of the page's content, ideally between 120
|
||||
and 158 characters.
|
||||
A brief summary of the page's content, ideally between
|
||||
120 and 158 characters.
|
||||
</p>
|
||||
{isEditingDescription ? (
|
||||
<Textarea
|
||||
@@ -278,20 +280,28 @@ export function MetaForm() {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
{metaData.headlines && metaData.headlines.length > 0 && (
|
||||
<TabsContent value="headlines">
|
||||
<Card className="w-full shadow-lg rounded-lg">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-xl text-card-foreground">
|
||||
Headlines Structure
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CardContent className="p-6">
|
||||
<HeadlineTree headlines={metaData.headlines} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{metaData.faq && metaData.faq.length > 0 && (
|
||||
<TabsContent value="faq">
|
||||
<Card className="w-full shadow-lg rounded-lg">
|
||||
<CardContent className="p-6">
|
||||
<FaqDisplay faqs={metaData.faq} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
)}
|
||||
</Tabs>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
export function ResultsSkeleton() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-10 w-28 rounded-md" />
|
||||
<Skeleton className="h-10 w-24 rounded-md" />
|
||||
<Skeleton className="h-10 w-20 rounded-md" />
|
||||
</div>
|
||||
<Card className="w-full shadow-lg rounded-lg">
|
||||
<CardHeader>
|
||||
<Skeleton className="h-6 w-48" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CardContent className="p-6">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
@@ -32,13 +34,6 @@ export function ResultsSkeleton() {
|
||||
<Skeleton className="h-5 w-32 mb-2" />
|
||||
<Skeleton className="aspect-video w-full rounded-md" />
|
||||
</div>
|
||||
<div>
|
||||
<Skeleton className="h-5 w-40 mb-3" />
|
||||
<div className="space-y-2">
|
||||
<Skeleton className="h-10 w-full" />
|
||||
<Skeleton className="h-10 w-full" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
@@ -59,23 +54,6 @@ export function ResultsSkeleton() {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<Skeleton className="h-6 w-40" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="border rounded-lg p-2 space-y-2">
|
||||
<Skeleton className="h-8 w-full" />
|
||||
<div className="ml-6">
|
||||
<Skeleton className="h-8 w-[90%]" />
|
||||
</div>
|
||||
<div className="ml-6">
|
||||
<Skeleton className="h-8 w-[90%]" />
|
||||
</div>
|
||||
<Skeleton className="h-8 w-full" />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user