fix: 修复 ruleStorage 写入失败处理与 CopyButton 成功态样式

This commit is contained in:
雨霖铃
2026-06-27 17:53:08 +08:00
parent 92bca1c728
commit 2967a6f79f
2 changed files with 9 additions and 6 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from 'react';
import { Check, Copy } from 'lucide-react';
import { copyTextToClipboard } from '@/utils/clipboard';
import { Button, type ButtonProps } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { toast } from 'sonner';
interface CopyButtonProps extends Omit<ButtonProps, 'children' | 'onClick'> {
@@ -53,7 +54,7 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
aria-label={tooltip ?? '复制'}
variant={variant}
size={size}
className={className}
className={cn(className, copied && 'text-emerald-500')}
{...props}
>
{copied ? (