import React from 'react';
import Taro from '@tarojs/taro';
import { View } from '@tarojs/components';

export default (props) => {
  const { className, style, ratio = 100 } = props;
  
  return (
    <View className={className} style={style}>
      <View style={{ paddingBottom: `${ratio}%`, position: 'relative', overflow: 'hidden' }}>
        <View style={{ width: '100%', height: '100%', position: 'absolute', left: 0, top: 0 }}>
          {props.children}
        </View>
      </View>
    </View>
  )
}
