mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add eslint linter
This commit is contained in:
@@ -1,41 +1,45 @@
|
||||
import {List, Tag, Tooltip, Typography} from "antd";
|
||||
import React from "react";
|
||||
import {Domain} from "../../utils/api";
|
||||
import {rdapRoleDetailTranslation, rdapRoleTranslation} from "../../utils/functions/rdapTranslation";
|
||||
import {roleToAvatar} from "../../utils/functions/roleToAvatar";
|
||||
import {rolesToColor} from "../../utils/functions/rolesToColor";
|
||||
import {sortDomainEntities} from "../../utils/functions/sortDomainEntities";
|
||||
import {extractDetailsFromJCard} from "../../utils/functions/extractDetailsFromJCard";
|
||||
import {List, Tag, Tooltip, Typography} from 'antd'
|
||||
import React from 'react'
|
||||
import {Domain} from '../../utils/api'
|
||||
import {rdapRoleDetailTranslation, rdapRoleTranslation} from '../../utils/functions/rdapTranslation'
|
||||
import {roleToAvatar} from '../../utils/functions/roleToAvatar'
|
||||
import {rolesToColor} from '../../utils/functions/rolesToColor'
|
||||
import {sortDomainEntities} from '../../utils/functions/sortDomainEntities'
|
||||
import {extractDetailsFromJCard} from '../../utils/functions/extractDetailsFromJCard'
|
||||
|
||||
export function EntitiesList({domain}: { domain: Domain }) {
|
||||
const rdapRoleTranslated = rdapRoleTranslation()
|
||||
const rdapRoleDetailTranslated = rdapRoleDetailTranslation()
|
||||
|
||||
const roleToTag = (r: string) => <Tooltip
|
||||
title={rdapRoleDetailTranslated[r as keyof typeof rdapRoleDetailTranslated] || undefined}>
|
||||
<Tag color={rolesToColor([r])}>{rdapRoleTranslated[r as keyof typeof rdapRoleTranslated] || r
|
||||
}</Tag>
|
||||
title={rdapRoleDetailTranslated[r as keyof typeof rdapRoleDetailTranslated] || undefined}
|
||||
>
|
||||
<Tag color={rolesToColor([r])}>{rdapRoleTranslated[r as keyof typeof rdapRoleTranslated] || r}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
|
||||
return <List
|
||||
className="demo-loadmore-list"
|
||||
itemLayout="horizontal"
|
||||
dataSource={sortDomainEntities(domain)}
|
||||
renderItem={(e) => {
|
||||
const details = extractDetailsFromJCard(e)
|
||||
return (
|
||||
<List
|
||||
className='demo-loadmore-list'
|
||||
itemLayout='horizontal'
|
||||
dataSource={sortDomainEntities(domain)}
|
||||
renderItem={(e) => {
|
||||
const details = extractDetailsFromJCard(e)
|
||||
|
||||
return <List.Item>
|
||||
<List.Item.Meta
|
||||
avatar={roleToAvatar(e)}
|
||||
title={<Typography.Text code>{e.entity.handle}</Typography.Text>}
|
||||
description={<>
|
||||
{details.fn && <div>👤 {details.fn}</div>}
|
||||
{details.organization && <div>🏢 {details.organization}</div>}
|
||||
</>}
|
||||
/>
|
||||
{e.roles.map(roleToTag)}
|
||||
</List.Item>
|
||||
}
|
||||
}
|
||||
/>
|
||||
}
|
||||
return (
|
||||
<List.Item>
|
||||
<List.Item.Meta
|
||||
avatar={roleToAvatar(e)}
|
||||
title={<Typography.Text code>{e.entity.handle}</Typography.Text>}
|
||||
description={<>
|
||||
{details.fn && <div>👤 {details.fn}</div>}
|
||||
{details.organization && <div>🏢 {details.organization}</div>}
|
||||
</>}
|
||||
/>
|
||||
{e.roles.map(roleToTag)}
|
||||
</List.Item>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user