mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
12 lines
669 B
TypeScript
12 lines
669 B
TypeScript
import * as React from 'react'
|
|
import { Link } from 'react-router-dom'
|
|
import { getValue } from '../../../../Utils/GetValue'
|
|
import { Item } from '../../../../types'
|
|
|
|
export const PopupButton = ({url, parameterField, text, colorField, item} : {url: string, parameterField?: string, text: string, colorField?: string, item? : Item}) => {
|
|
return (
|
|
<Link to={`${url}/${parameterField? getValue(item,parameterField):``}`}><button style={{backgroundColor: `${colorField && getValue(item,colorField)? getValue(item,colorField) : item?.layer?.markerDefaultColor}`}} className="tw-btn tw-text-white tw-btn-sm tw-float-right">{text}</button></Link>
|
|
|
|
)
|
|
}
|