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

teableio / teable / 8536869866

03 Apr 2024 10:05AM CUT coverage: 21.234% (-0.3%) from 21.535%
8536869866

Pull #514

github

web-flow
Merge 91a25d710 into 45ee7ebb3
Pull Request #514: refactor: user and link selector

1394 of 2532 branches covered (55.06%)

27 of 1620 new or added lines in 60 files covered. (1.67%)

4 existing lines in 2 files now uncovered.

14588 of 68702 relevant lines covered (21.23%)

2.02 hits per line

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

0.0
/packages/sdk/src/components/editor/link/LinkCard.tsx
1
import { X } from '@teable/icons';
×
2
import { Button, cn } from '@teable/ui-lib';
×
3
import { noop } from 'lodash';
×
NEW
4
import { useTranslation } from '../../../context/app/i18n';
×
5

×
6
interface ILinkCardProps {
×
7
  title?: string;
×
8
  readonly?: boolean;
×
9
  className?: string;
×
10
  wrapClassName?: string;
×
11
  onClick?: () => void;
×
12
  onDelete?: () => void;
×
13
}
×
14

×
15
export const LinkCard = (props: ILinkCardProps) => {
×
16
  const { title, readonly, className, wrapClassName, onClick, onDelete } = props;
×
NEW
17
  const { t } = useTranslation();
×
18
  return (
×
19
    <div
×
20
      tabIndex={-1}
×
21
      role={'button'}
×
22
      className={cn(
×
23
        'group relative w-full cursor-pointer rounded-md border px-4 py-2 shadow-sm',
×
24
        wrapClassName
×
25
      )}
×
26
      onClick={readonly ? undefined : onClick}
×
27
      onKeyDown={noop}
×
28
    >
×
NEW
29
      <div
×
NEW
30
        className={cn('w-full font-mono text-sm', className)}
×
NEW
31
        title={title || t('common.unnamedRecord')}
×
NEW
32
      >
×
NEW
33
        {title || t('common.unnamedRecord')}
×
34
      </div>
×
35
      {!readonly && (
×
36
        <Button
×
37
          className="absolute right-0 top-0 size-4 -translate-y-1/2 translate-x-1/2 rounded-full md:opacity-0 md:group-hover:opacity-100"
×
38
          size={'icon'}
×
39
          tabIndex={-1}
×
40
          onClick={(e) => {
×
41
            e.stopPropagation();
×
42
            onDelete?.();
×
43
          }}
×
44
        >
×
45
          <X />
×
46
        </Button>
×
47
      )}
×
48
    </div>
×
49
  );
×
50
};
×
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