创赢未来评分系统 - 初始化提交(移除大文件)

This commit is contained in:
爽哒哒
2026-03-18 22:28:45 +08:00
commit f26d35da66
315 changed files with 36043 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import React, { useState } from 'react'
import { View, Text, ScrollView } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { AtIcon } from 'taro-ui'
import './index.scss'
interface Props {
code: string
language?: string
}
const CodeBlock: React.FC<Props> = ({ code, language }) => {
const [copied, setCopied] = useState(false)
const handleCopy = (e) => {
e.stopPropagation()
Taro.setClipboardData({
data: code,
success: () => {
setCopied(true)
setTimeout(() => setCopied(false), 2000)
}
})
}
return (
<View className='markdown-code-block'>
<View className='code-header'>
<Text className='language'>{language || 'text'}</Text>
<View className='copy-btn' onClick={handleCopy}>
<AtIcon value='copy' size='14' color='#ccc' />
<Text className='copy-text'>{copied ? '已复制' : '复制'}</Text>
</View>
</View>
<ScrollView scrollX scrollY className='code-content'>
<Text userSelect className='code-text'>{code}</Text>
</ScrollView>
</View>
)
}
export default CodeBlock