PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Assist / components / dashboard / buttons / ActionButton.jsx

ActionButton.jsx in Extendify trunk, at src/Assist/components/dashboard/buttons/ActionButton.jsx

31 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { EventButton } from '@assist/components/dashboard/buttons/EventButton';
2 import { LinkButton } from '@assist/components/dashboard/buttons/LinkButton';
3 import { ModalButton } from '@assist/components/dashboard/buttons/ModalButton';
4 import { TourButton } from '@assist/components/dashboard/buttons/TourButton';
5 import { useTours } from '@assist/hooks/useTours';
6 import { useTasksStore } from '@assist/state/tasks';
7
8 export const ActionButton = ({ task }) => {
9 const { isCompleted } = useTasksStore();
10 const { finishedTour } = useTours();
11
12 if (task.event) {
13 return <EventButton task={task} completed={isCompleted(task.slug)} />;
14 }
15
16 if (task.type === 'modal')
17 return <ModalButton task={task} completed={isCompleted(task.slug)} />;
18
19 if (['html-text-button', 'internalLink'].includes(task.type))
20 return <LinkButton task={task} completed={isCompleted(task.slug)} />;
21
22 if (task.type === 'tour')
23 return (
24 <TourButton
25 task={task}
26 completed={finishedTour(task.slug) || isCompleted(task.slug)}
27 />
28 );
29 return null;
30 };
31