• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 10157927627

30 Jul 2024 07:19AM UTC coverage: 17.698% (-64.3%) from 81.981%
10157927627

push

github

web-flow
fix: url crash (#776)

1383 of 2807 branches covered (49.27%)

0 of 7 new or added lines in 2 files covered. (0.0%)

14026 of 79251 relevant lines covered (17.7%)

1.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/nextjs-app/src/features/app/blocks/share/view/EmbedFooter.tsx
1
import { ArrowUpRight, TeableNew } from '@teable/icons';
×
2
import Link from 'next/link';
×
3
import { useRouter } from 'next/router';
×
4
import { useTranslation } from 'next-i18next';
×
5
import { shareConfig } from '@/features/i18n/share.config';
×
6

×
7
export const EmbedFooter = ({
×
8
  hideBranding,
×
9
  hideNewPage,
×
10
}: {
×
11
  hideBranding?: boolean;
×
12
  hideNewPage?: boolean;
×
13
}) => {
×
14
  const router = useRouter();
×
15
  const { t } = useTranslation(shareConfig.i18nNamespaces);
×
16
  const fullPath = router.asPath;
×
NEW
17
  const url = new URL(fullPath, 'https://app.teable.io'); // Use a dummy base URL
×
18
  url.searchParams.delete('embed');
×
19
  const pathWithoutEmbed = `${url.pathname}${url.search}`;
×
20

×
21
  return (
×
22
    <div className="flex items-center justify-between border-t px-2 py-1 text-xs">
×
23
      {!hideBranding && (
×
24
        <Link href="/" className="flex items-center gap-1" target="_blank">
×
25
          <TeableNew className="size-4 text-black" />
×
26
          Teable
×
27
        </Link>
×
28
      )}
×
29
      {!hideNewPage && (
×
30
        <Link className="flex gap-1" href={pathWithoutEmbed} target="_blank">
×
31
          <ArrowUpRight className="size-4" />
×
32
          {t('share:openOnNewPage')}
×
33
        </Link>
×
34
      )}
×
35
    </div>
×
36
  );
×
37
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc