mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-12 23:36:00 +00:00
28 lines
720 B
TypeScript
28 lines
720 B
TypeScript
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
import { TextView } from '#components/Map'
|
|
import { Item } from '#src/types'
|
|
import { getValue } from '#utils/GetValue'
|
|
|
|
export const ProfileTextView = ({
|
|
item,
|
|
dataField,
|
|
heading,
|
|
hideWhenEmpty,
|
|
}: {
|
|
item: Item
|
|
dataField: string
|
|
heading: string
|
|
hideWhenEmpty: boolean
|
|
}) => {
|
|
return (
|
|
<div className='tw-my-10 tw-mt-2 tw-px-6'>
|
|
{!(getValue(item, dataField) === '' && hideWhenEmpty) && (
|
|
<h2 className='tw-text-lg tw-font-semibold'>{heading}</h2>
|
|
)}
|
|
<div className='tw-mt-2 tw-text-sm'>
|
|
<TextView rawText={dataField ? getValue(item, dataField) : getValue(item, 'text')} />
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|