mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 11:19:10 +08:00
- Updated migration status to reflect the migration of additional components, reducing the total migrated count to 34 and increasing the refactored count to 14. - Enhanced component files by refactoring several components to improve structure and styling, including CopyButton, CustomTag, and IndicatorLight. - Added new stories for components such as CopyButton, CustomCollapse, and DividerWithText to improve documentation and showcase usage. - Adjusted TypeScript configuration to include story files for better type checking.
38 lines
852 B
TypeScript
38 lines
852 B
TypeScript
// Original: src/renderer/src/components/Spinner.tsx
|
|
import { motion } from 'framer-motion'
|
|
import { Search } from 'lucide-react'
|
|
|
|
interface Props {
|
|
text: React.ReactNode
|
|
className?: string
|
|
}
|
|
|
|
// Define variants for the spinner animation
|
|
const spinnerVariants = {
|
|
defaultColor: {
|
|
color: '#2a2a2a'
|
|
},
|
|
dimmed: {
|
|
color: '#8C9296'
|
|
}
|
|
}
|
|
|
|
export default function Spinner({ text, className = '' }: Props) {
|
|
return (
|
|
<motion.div
|
|
className={`flex items-center gap-1 p-0 ${className}`}
|
|
variants={spinnerVariants}
|
|
initial="defaultColor"
|
|
animate={['defaultColor', 'dimmed']}
|
|
transition={{
|
|
duration: 0.8,
|
|
repeat: Infinity,
|
|
repeatType: 'reverse',
|
|
ease: 'easeInOut'
|
|
}}>
|
|
<Search size={16} style={{ color: 'unset' }} />
|
|
<span>{text}</span>
|
|
</motion.div>
|
|
)
|
|
}
|