[dyad] Update headline controls to icons - wrote 1 file(s)
This commit is contained in:
@@ -4,9 +4,15 @@ import { useState } from "react";
|
|||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import type { HeadlineNode } from "@/app/actions";
|
import type { HeadlineNode } from "@/app/actions";
|
||||||
import { KeywordHighlighter } from "./keyword-highlighter";
|
import { KeywordHighlighter } from "./keyword-highlighter";
|
||||||
import { ChevronDown } from "lucide-react";
|
import { ChevronDown, ChevronsUp, ChevronsDown } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from "@/components/ui/tooltip";
|
||||||
|
|
||||||
interface HeadlineTreeProps {
|
interface HeadlineTreeProps {
|
||||||
headlines: HeadlineNode[];
|
headlines: HeadlineNode[];
|
||||||
@@ -137,13 +143,48 @@ export function HeadlineTree({ headlines, keyword }: HeadlineTreeProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="w-full rounded-lg overflow-hidden">
|
<div className="w-full rounded-lg overflow-hidden">
|
||||||
{hasCollapsibleNodes && (
|
{hasCollapsibleNodes && (
|
||||||
<div className="flex items-center gap-2 p-4 border-b bg-muted/50">
|
<div className="flex items-center justify-between p-4 border-b bg-muted/50">
|
||||||
<Button variant="outline" size="sm" onClick={expandAll}>
|
<h4 className="font-semibold text-sm text-muted-foreground">
|
||||||
Expand All
|
Headline Structure
|
||||||
|
</h4>
|
||||||
|
<div className="flex items-center gap-1">
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={expandAll}
|
||||||
|
className="h-8 w-8"
|
||||||
|
>
|
||||||
|
<ChevronsUp className="h-4 w-4" />
|
||||||
|
<span className="sr-only">Expand All</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" size="sm" onClick={collapseAll}>
|
</TooltipTrigger>
|
||||||
Collapse All
|
<TooltipContent>
|
||||||
|
<p>Expand All</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={collapseAll}
|
||||||
|
className="h-8 w-8"
|
||||||
|
>
|
||||||
|
<ChevronsDown className="h-4 w-4" />
|
||||||
|
<span className="sr-only">Collapse All</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<p>Collapse All</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="-mt-px">
|
<div className="-mt-px">
|
||||||
|
|||||||
Reference in New Issue
Block a user