import React from 'react'; import s0 from './Rule.module.scss'; const colorMap = { _default: '#59caf9', DIRECT: '#f5bc41', REJECT: '#cb3166', }; function getStyleFor({ proxy }) { let color = colorMap._default; if (colorMap[proxy]) { color = colorMap[proxy]; } return { color }; } type Props = { id?: number; type?: string; payload?: string; proxy?: string; }; function Rule({ type, payload, proxy, id }: Props) { const styleProxy = getStyleFor({ proxy }); return (
{id}
{payload}
{type}
{proxy}
); } export default Rule;