|
1
|
import { useTranslation } from "react-i18next" |
|
2
|
import { PlaceholderCell } from "../placeholder-cell" |
|
3
|
|
|
4
|
type NameCellProps = { |
|
5
|
firstName?: string | null |
|
6
|
lastName?: string | null |
|
7
|
} |
|
8
|
|
|
9
|
export const NameCell = ({ firstName, lastName }: NameCellProps) => { |
|
10
|
if (!firstName && !lastName) { |
|
11
|
return <PlaceholderCell /> |
|
12
|
} |
|
13
|
|
|
14
|
const name = [firstName, lastName].filter(Boolean).join(" ") |
|
15
|
|
|
16
|
return ( |
|
17
|
<div className="flex h-full w-full items-center overflow-hidden"> |
|
18
|
<span className="truncate">{name}</span> |
|
19
|
</div> |
|
20
|
) |
|
21
|
} |
|
22
|
|
|
23
|
export const NameHeader = () => { |
|
24
|
const { t } = useTranslation() |
|
25
|
|
|
26
|
return ( |
|
27
|
<div className="flex h-full w-full items-center"> |
|
28
|
<span className="truncate">{t("fields.name")}</span> |
|
29
|
</div> |
|
30
|
) |
|
31
|
} |