Spaces:
Runtime error
Runtime error
File size: 1,078 Bytes
229b3b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
import { Button } from '@/components/ui/button';
import { DEFAULT_FONT } from '@/data/fonts';
import { ADD_TEXT, dispatcher } from '@designcombo/core';
import { nanoid } from 'nanoid';
export const Texts = () => {
const handleAddText = () => {
dispatcher?.dispatch(ADD_TEXT, {
payload: {
id: nanoid(),
details: {
text: 'Heading',
fontSize: 120,
width: 600,
fontUrl: DEFAULT_FONT.url,
fontFamily: DEFAULT_FONT.postScriptName,
color: '#ffffff',
wordWrap: 'break-word',
wordBreak: 'break-all',
textAlign: 'center',
},
},
options: {},
});
};
return (
<div className="flex-1">
<div className="text-md text-text-primary font-medium h-12 flex items-center px-4">
Text
</div>
<div className="px-4">
<Button
onClick={handleAddText}
size="sm"
variant="secondary"
className="w-full"
>
Add text
</Button>
</div>
</div>
);
};
|