import MEmpty from '@/components/m-empty';
import MHeader from '@/components/m-header';
import { browser } from '@/helpers/utils';
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';

export default defineComponent({
  name: 'page-404',
  setup() {
    const router = useRouter();
    return () => (
      <>
        <MHeader />
        <MEmpty
          style={{
            'min-height': 'calc(100vh - var(--van-nav-bar-height))',
            paddingTop: '0 !important'
          }}
          showButton
          description="页面找不到了～"
          image="404"
          onClick={() => {
            if (browser().isApp) {
              postMessage({ api: 'back' });
            } else {
              router.back();
            }
          }}
        />
      </>
    );
  }
});
