import {View, Text, Textarea} from '@tarojs/components';
import {Switch} from '@nutui/nutui-react-taro';
import classNames from 'classnames';

export default function Exception({checked, onChange}) {
  return (
    <>
      <View className='flex items-center'>
        <Switch
          activeColor='#58C6EA'
          activeText='是'
          inactiveText='否'
          checked={checked}
          onChange={onChange}
        />
        <Text className='text-sm text-[#999] ml-2'>是否异常</Text>
      </View>

      <Textarea
        className={classNames(
          'border border-solid border-gray-200 rounded-md mt-3 w-[calc(100%-32px)] p-4',
          {hidden: !checked},
        )}
        placeholder='请输入异常原因'
      />
    </>
  );
}
