2024-04-12 09:52:36 -05:00
|
|
|
import { PenpotFile } from '@ui/lib/penpot';
|
|
|
|
import { PenpotNode } from '@ui/lib/types/penpotNode';
|
|
|
|
|
2024-04-08 10:50:01 -05:00
|
|
|
import {
|
2024-04-12 06:55:42 -05:00
|
|
|
createPenpotArtboard,
|
2024-04-08 10:50:01 -05:00
|
|
|
createPenpotCircle,
|
|
|
|
createPenpotGroup,
|
|
|
|
createPenpotImage,
|
|
|
|
createPenpotRectangle,
|
|
|
|
createPenpotText
|
|
|
|
} from '.';
|
|
|
|
|
2024-04-12 06:55:42 -05:00
|
|
|
export const createPenpotItem = (file: PenpotFile, node: PenpotNode) => {
|
|
|
|
switch (node.type) {
|
|
|
|
case 'rect':
|
|
|
|
return createPenpotRectangle(file, node);
|
|
|
|
case 'circle':
|
|
|
|
return createPenpotCircle(file, node);
|
|
|
|
case 'frame':
|
|
|
|
return createPenpotArtboard(file, node);
|
|
|
|
case 'group':
|
|
|
|
return createPenpotGroup(file, node);
|
|
|
|
case 'image':
|
|
|
|
return createPenpotImage(file, node);
|
|
|
|
case 'text':
|
|
|
|
return createPenpotText(file, node);
|
2024-04-08 10:50:01 -05:00
|
|
|
}
|
|
|
|
};
|