/**
 * 薪资记录项组件
 * 显示单条薪资记录信息
 */
import React from 'react'
import { View, Text } from '@tarojs/components'
import { SalaryRecord } from '../types/employment'
import { formatMonth } from '../types/employment'

interface SalaryRecordItemProps {
  record: SalaryRecord
}

export const SalaryRecordItem: React.FC<SalaryRecordItemProps> = ({ record }) => {
  return (
    <View className="flex justify-between items-center p-3 border border-gray-100 rounded-lg">
      <View className="flex flex-col">
        <Text className="text-sm font-medium text-gray-800">{formatMonth(record.month)}</Text>
        <View className="flex flex-col">
          <Text className="text-xs text-gray-500">
            {record.companyName || '未知企业'} · {record.orderName || '未知岗位'}
          </Text>
        </View>
      </View>
      <Text className="text-lg font-bold text-gray-800">
        ¥{record.salaryAmount.toLocaleString()}
      </Text>
    </View>
  )
}
