Skip to content

Commit

Permalink
feat: add DuplicateButton to NodeSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
nomorepanic committed Sep 16, 2024
1 parent cdeda50 commit 54b868d
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { Slider, Box, TextField } from '@mui/material';
import { Slider, TextField, Grid } from '@mui/material';
import { ModelItem, ViewItem } from 'src/types';
import { MarkdownEditor } from 'src/components/MarkdownEditor/MarkdownEditor';
import { useModelItem } from 'src/hooks/useModelItem';
import { DeleteButton } from '../../components/DeleteButton';
import { DuplicateButton } from '../../components/DuplicateButton';
import { Section } from '../../components/Section';

export type NodeUpdates = {
Expand All @@ -16,13 +17,15 @@ interface Props {
onModelItemUpdated: (updates: Partial<ModelItem>) => void;
onViewItemUpdated: (updates: Partial<ViewItem>) => void;
onDeleted: () => void;
onDuplicated: () => void;
}

export const NodeSettings = ({
node,
onModelItemUpdated,
onViewItemUpdated,
onDeleted
onDeleted,
onDuplicated
}: Props) => {
const modelItem = useModelItem(node.id);

Expand Down Expand Up @@ -61,11 +64,14 @@ export const NodeSettings = ({
/>
</Section>
)}
<Section>
<Box>
<Grid container spacing={2} sx={{ pt: 3, px: 3 }}>
<Grid item>
<DeleteButton onClick={onDeleted} />
</Box>
</Section>
</Grid>
<Grid item>
<DuplicateButton onClick={onDuplicated} />
</Grid>
</Grid>
</>
);
};

0 comments on commit 54b868d

Please sign in to comment.