import { useTranslation } from 'next-i18next'
import { Tr, KeyTd, ValTd, Attributes, pointCoords } from '../path/index'
const textInfo = (props) => props.point
? (
Text info
Coordinates
{pointCoords(props.point)}
Name
{props.pointName}
Part
{props.partName}
Attributes
) : null
const XrayText = props => (
{ evt.stopPropagation(); props.showInfo(textInfo(props)) }}
/>
)
const TextSpans = ({ point, className='', style={}, onClick=null }) => {
const { t } = useTranslation(['app'])
let text = []
// Handle translation
let translated = ''
for (let string of point.attributes.getAsArray('data-text')) {
translated += t(string.toString()).replace(/"/g, '"') + ' '
}
// Handle muti-line text
if (translated.indexOf('\n') !== -1) {
let key = 0
let lines = translated.split('\n')
text.push({lines.shift()})
for (let line of lines) {
key++
text.push(
{line.toString().replace(/"/g, '"')}
)
}
} else text.push({translated})
return text
}
const Text = (props) => {
const attr = props.point.attributes.asPropsIfPrefixIs('data-text-')
return (
<>
{props.gist._state?.xray?.enabled && }
>
)
}
export default Text