github
1381 of 2780 branches covered (49.68%)
0 of 440 new or added lines in 15 files covered. (0.0%)
13875 of 77148 relevant lines covered (17.98%)
1.8 hits per line
NEW
|
import { TeableNew } from '@teable/icons'; |
|
NEW
|
import { cn } from '@teable/ui-lib/shadcn'; |
× |
NEW
|
import Image from 'next/image'; |
× |
NEW
|
import { usePreviewUrl } from '../../hooks/usePreviewUrl'; |
× |
NEW
|
|
× |
NEW
|
export const OAuthLogo = (props: { logo?: string; name: string; className?: string }) => { |
× |
NEW
|
const { logo, name, className } = props;
|
× |
NEW
|
|
× |
NEW
|
const getPreviewUrl = usePreviewUrl();
|
× |
NEW
|
return (
|
× |
NEW
|
<div className={cn('relative size-16 overflow-hidden rounded-sm', className)}> |
× |
NEW
|
{logo ? ( |
× |
NEW
|
<Image |
× |
NEW
|
src={getPreviewUrl(logo)} |
× |
NEW
|
alt={name} |
× |
NEW
|
fill |
× |
NEW
|
sizes="100%"
|
× |
NEW
|
style={{ |
× |
NEW
|
objectFit: 'contain', |
× |
NEW
|
}} |
× |
NEW
|
/> |
× |
NEW
|
) : ( |
× |
NEW
|
<TeableNew className={cn('size-16 text-black', className)} /> |
× |
NEW
|
)} |
× |
NEW
|
</div> |
× |
NEW
|
); |
× |
NEW
|
}; |
× |