Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Labels #331

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/content/series/LabelModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { Modal } from "../../ui";
import { Series } from "../../utils/types";

type LabelModalProps = {
series: Series;
onClose: () => void;
show: boolean;
};

const LabelModal: React.FC<LabelModalProps> = ({ series, onClose, show }) => {
return (
<Modal show={show} size='lg'>
<Modal.Header onClose={onClose}>Assign Labels</Modal.Header>
<Modal.Body>
<p>{series.id}</p>
</Modal.Body>
</Modal>
);
};

export default LabelModal;
25 changes: 15 additions & 10 deletions src/content/series/SeriesActions.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
// SeriesActions.tsx
import React from 'react';
import React, { useState } from 'react';
import { Series } from "../../utils/types";
import DropdownButton from '../../ui/menu/DropDownButton';
import { Download, Edit, Eye, Label, Trash } from '../../icons';
import LabelModal from './LabelModal'; // Assure-toi d'importer le composant LabelModal

type SeriesActionsProps = {
series: Series;
onActionClick: (action: string, series: Series) => void;
};

const SeriesActions: React.FC<SeriesActionsProps> = ({ series, onActionClick }) => {
const [isLabelsModalOpen, setLabelsModalOpen] = useState(false);

const options = [
{
label: 'Labels',
icon: <Label />,
color: 'bg-indigo-500',
action: () => setLabelsModalOpen(true)
},
action: () => setLabelsModalOpen(true)
},
{
label: 'Modify',
icon: <Edit />,
Expand All @@ -27,13 +29,13 @@ const SeriesActions: React.FC<SeriesActionsProps> = ({ series, onActionClick })
label: 'Metadata',
icon: <Eye />,
color: 'green',
action: () => onActionClick('metadata', series),
action: () => onActionClick('metadata', series)
},
{
label: 'Preview Series',
icon: <Eye />,
color: 'green',
action: () => onActionClick('preview', series),
action: () => onActionClick('preview', series)
},
{
label: 'Download',
Expand Down Expand Up @@ -66,12 +68,15 @@ const SeriesActions: React.FC<SeriesActionsProps> = ({ series, onActionClick })
buttonText="Actions"
row={series}
/>
{isLabelsModalOpen && (
<LabelModal
series={series}
show={isLabelsModalOpen}
onClose={() => setLabelsModalOpen(false)}
/>
)}
</div>
);
};

export default SeriesActions;

function setLabelsModalOpen(arg0: boolean) {
throw new Error('Function not implemented.');
}