<script setup>

// Use this in any component after injecting from the Index.vue provided Dialog
//
// const subscriptionRequiredDialog = inject('subscriptionRequiredDialog');
// subscriptionRequiredDialog.value.open();

import { useTemplateRef } from 'vue';
import { Dialog, Button } from '@cloudron/pankow';

const dialog = useTemplateRef('dialog');

function close() {
  dialog.value.close();
}

defineExpose({
  async open() {
    dialog.value.open();
  }
});

</script>

<template>
  <Dialog ref="dialog" title="Subscription required" :show-x="true">
    <div style="margin-bottom: 30px; margin-top: 10px;">To use this feature a Cloudron subscription needs to be set up.</div>
    <Button href="/#/cloudron-account" @click="close()">Set up</Button>
  </Dialog>
</template>
