import { defineComponent, ref, computed, onMounted, onUnmounted, openBlock, createElementBlock, toDisplayString } from "vue";
const _hoisted_1 = { class: "timing" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "RoomTime",
  setup(__props) {
    const meetingTime = ref(0);
    let intervalId = null;
    const formattedTime = computed(() => {
      const minutes = Math.floor(meetingTime.value / 60);
      const seconds = meetingTime.value % 60;
      return `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
    });
    function startTimer() {
      intervalId = setInterval(() => {
        meetingTime.value += 1;
      }, 1e3);
    }
    onMounted(() => {
      startTimer();
    });
    onUnmounted(() => {
      intervalId && clearInterval(intervalId);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(formattedTime.value), 1);
    };
  }
});
export {
  _sfc_main as default
};
