@theoplayer/react-native-ui
Version:
A React Native UI for @theoplayer/react-native
40 lines (38 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimeLabel = exports.DEFAULT_TIME_LABEL_STYLE = void 0;
var _react = _interopRequireDefault(require("react"));
var _StaticTimeLabel = require("./StaticTimeLabel");
var _barrel = require("../../hooks/barrel");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* The default style for the time label.
*/
const DEFAULT_TIME_LABEL_STYLE = exports.DEFAULT_TIME_LABEL_STYLE = {
marginLeft: 10,
marginRight: 10,
height: 20,
alignSelf: 'center'
};
/**
* The default time label component for the `react-native-theoplayer` UI.
*/
const TimeLabel = props => {
const currentTime = (0, _barrel.useCurrentTime)();
const duration = (0, _barrel.useDuration)();
const {
showDuration,
style
} = props;
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StaticTimeLabel.StaticTimeLabel, {
showDuration: showDuration,
time: currentTime,
duration: duration,
style: [DEFAULT_TIME_LABEL_STYLE, style]
});
};
exports.TimeLabel = TimeLabel;
//# sourceMappingURL=TimeLabel.js.map