Update labels and toolbar

This commit is contained in:
Nate Kelley 2025-09-09 22:07:53 -06:00
parent c602c1f98c
commit 84b43c3d6f
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 11 additions and 8 deletions

View File

@ -323,7 +323,7 @@ export const NodeTypeLabels = {
keywords: [],
},
caption: {
label: 'Caption',
label: 'Add caption',
keyboard: undefined,
keywords: [],
},

View File

@ -11,6 +11,7 @@ import { AddMetricModal } from '@/components/features/dashboard/AddMetricModal';
import { Button } from '@/components/ui/buttons';
import { PopoverAnchor, PopoverBase, PopoverContent } from '@/components/ui/popover';
import { Separator } from '@/components/ui/separator';
import { AppTooltip } from '@/components/ui/tooltip';
import { NodeTypeIcons } from '../../config/icons';
import { NodeTypeLabels } from '../../config/labels';
import { MetricPlugin, type TMetricElement } from '../../plugins/metric-kit';
@ -65,17 +66,19 @@ export function MetricToolbar({
<PopoverBase open={isOpen} modal={false}>
<PopoverAnchor>{children}</PopoverAnchor>
<PopoverContent className="w-auto p-1" onOpenAutoFocus={(e) => e.preventDefault()}>
<div className="box-content flex items-center">
<Button onClick={onOpenEdit} variant="ghost">
{NodeTypeLabels.editMetric?.label ?? 'Edit metric'}
</Button>
<PopoverContent className="w-auto p-2 mt-1" onOpenAutoFocus={(e) => e.preventDefault()}>
<div className="box-content flex items-center space-x-1">
{/* <Button onClick={onOpenEdit} variant="ghost">
{NodeTypeLabels.editMetric?.label}
</Button> */}
<CaptionButton variant="ghost">{NodeTypeLabels.caption.label}</CaptionButton>
<Separator orientation="vertical" className="mx-1 h-6" />
{/* <Separator orientation="vertical" className="mx-1 h-6" /> */}
<Button prefix={<NodeTypeIcons.trash />} variant="ghost" {...removeButtonProps}></Button>
<Button prefix={<NodeTypeIcons.trash />} variant="ghost" {...removeButtonProps}>
Delete
</Button>
</div>
</PopoverContent>