/* global Vue */ require('./help_state'); require('./collapsed_state'); require('./spent_only_pane'); require('./no_tracking_pane'); require('./estimate_only_pane'); require('./comparison_pane'); (() => { Vue.component('issuable-time-tracker', { name: 'issuable-time-tracker', props: [ 'time_estimate', 'time_spent', 'human_time_estimate', 'human_time_spent', 'docsUrl', ], data() { return { showHelp: false, }; }, computed: { timeSpent() { return this.time_spent; }, timeEstimate() { return this.time_estimate; }, timeEstimateHumanReadable() { return this.human_time_estimate; }, timeSpentHumanReadable() { return this.human_time_spent; }, hasTimeSpent() { return !!this.timeSpent; }, hasTimeEstimate() { return !!this.timeEstimate; }, showComparisonState() { return this.hasTimeEstimate && this.hasTimeSpent; }, showEstimateOnlyState() { return this.hasTimeEstimate && !this.hasTimeSpent; }, showSpentOnlyState() { return this.hasTimeSpent && !this.hasTimeEstimate; }, showNoTimeTrackingState() { return !this.hasTimeEstimate && !this.hasTimeSpent; }, showHelpState() { return !!this.showHelp; }, }, methods: { toggleHelpState(show) { this.showHelp = show; }, }, template: `