claude-code-best/packages/remote-control-server/web/components/ai-elements/shimmer.tsx
claude-code-best d719508733 feat: ACP 协议版本 remote control (#293)
Commit: 2e9aaf49
54 files changed — ACP protocol + RCS bridge enhancements
CCP-specific files (CLAUDE.md, mint.json, package.json, prompts.ts) kept ours
2026-06-04 23:53:06 +08:00

48 lines
909 B
TypeScript

"use client";
import { cn } from "../../src/lib/utils";
import { motion } from "motion/react";
import {
type ElementType,
type JSX,
memo,
} from "react";
export interface TextShimmerProps {
children: string;
as?: ElementType;
className?: string;
duration?: number;
spread?: number;
}
const ShimmerComponent = ({
children,
as: Component = "p",
className,
duration = 2,
}: TextShimmerProps) => {
const MotionComponent = motion.create(
Component as keyof JSX.IntrinsicElements
);
return (
<MotionComponent
animate={{ opacity: [0.5, 1, 0.5] }}
className={cn(
"relative inline-block text-muted-foreground",
className
)}
transition={{
repeat: Number.POSITIVE_INFINITY,
duration,
ease: "easeInOut",
}}
>
{children}
</MotionComponent>
);
};
export const Shimmer = memo(ShimmerComponent);