}> = ({ field }) => {
const t = useTranslate()
const [show, setShow] = useState(false)
const { onRightClick, ContextMenuContainer, Item } = useItemFieldContextMenu()
const onToggle = useCallback(() => setShow(x => !x), [])
const fields = field.v.split(" ")
return (
<>
{show ? (
setShow(x => !x)}
style={{
fontFamily: "var(--monospace)",
paddingTop: 5,
}}
>
{fields.map((item, i) => (
{item}
))}
) : (
{fields.length} {fields.length === 1 ? t.noun.item : t.noun.items}
)}
- {show ? t.action.hide : t.action.show}
>
)
}