1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { useState } from 'react';
import { Typography, Card } from 'antd';
import WageForm from '../components/tools/WageForm';
import WageResultPanel from '../components/tools/WageResultPanel';
import { calculateUnpaidSalary } from '../utils/wageCalculator';
 
const { Title } = Typography;
 
const WageCalculatorPage = () => {
  const [result, setResult] = useState(null);
 
  const handleCalculate = (input) => {
    const calcResult = calculateUnpaidSalary(input);
    setResult(calcResult);
  };
 
  const handleReset = () => {
    setResult(null);
  };
 
  return (
    <div>
      <Title level={3}>欠薪计算器</Title>
      <Card style={{ marginBottom: 16 }} title="填写欠薪信息">
        <WageForm onCalculate={handleCalculate} onReset={handleReset} />
      </Card>
 
      <Card title="计算结果">
        <WageResultPanel result={result} />
      </Card>
    </div>
  );
};
 
export default WageCalculatorPage;