import React, { CSSProperties } from 'react'; import { TEXT_COLORS, FONT_FAMILIES, TEXT_SIZES, FONT_WEIGHTS, } from '../../../constants/presets'; import { StylePanelProps, SectionLabel, ColorSwatchGrid, PresetButtonGrid, useNodeProp, } from './shared'; /* ---------- TEXT ---------- */ export const TextStylePanel: React.FC = ({ selectedId, nodeProps }) => { const style: CSSProperties = nodeProps.style || {}; const { setPropStyle } = useNodeProp(selectedId); return ( <>
Text Color setPropStyle('color', v)} />
Font Family setPropStyle('fontFamily', v)} />
Text Size setPropStyle('fontSize', v)} />
Font Weight setPropStyle('fontWeight', v)} />
Alignment
{(['left', 'center', 'right', 'justify'] as const).map((a) => ( ))}
); };