import { useState } from 'react';
import { FONTS } from '../../constants/fonts';
export function TextTab({ onAddText }) {
const [text, setText] = useState('Your text here');
const [fontFamily, setFontFamily] = useState('Roboto');
const [fontSize, setFontSize] = useState(48);
const [fill, setFill] = useState('#0f172a');
const handleAddText = () => {
onAddText({
type: 'text',
x: 150,
y: 150,
text,
fontFamily,
fontSize,
fill,
rotation: 0,
});
};
return (
Add Text
{/* Text input */}
{/* Font selector */}
{/* Font size */}
setFontSize(parseInt(e.target.value, 10))}
style={{ width: '100%' }}
/>
{/* Color picker */}
setFill(e.target.value)}
style={{
width: '40px',
height: '40px',
border: `1px solid var(--border)`,
borderRadius: 'var(--radius-sm)',
cursor: 'pointer',
padding: '2px',
}}
/>
setFill(e.target.value)}
style={{
flex: 1,
padding: '0.75rem',
border: `1px solid var(--border)`,
borderRadius: 'var(--radius-md)',
fontSize: '13px',
fontFamily: 'var(--font-mono)',
}}
/>
{/* Preview */}
{/* Add Text button */}
);
}