| 1 |
import { UpdateLogo } from '@assist/components/tasks/UpdateLogo'; |
| 2 |
import { UpdateSiteDescription } from '@assist/components/tasks/UpdateSiteDescription'; |
| 3 |
import { UpdateSiteIcon } from '@assist/components/tasks/UpdateSiteIcon'; |
| 4 |
import { useGlobalStore } from '@assist/state/globals'; |
| 5 |
|
| 6 |
export const ModalButton = ({ task, completed }) => { |
| 7 |
const { pushModal } = useGlobalStore(); |
| 8 |
|
| 9 |
const Components = { |
| 10 |
logo: UpdateLogo, |
| 11 |
'site-description': UpdateSiteDescription, |
| 12 |
'site-icon': UpdateSiteIcon, |
| 13 |
}; |
| 14 |
|
| 15 |
if (!Components[task.slug]) return null; |
| 16 |
|
| 17 |
return ( |
| 18 |
<button |
| 19 |
type="button" |
| 20 |
className="min-w-24 rounded-xs bg-design-main px-4 py-2.5 text-sm font-medium text-design-text hover:opacity-90" |
| 21 |
onClick={() => pushModal(Components[task.slug])} |
| 22 |
> |
| 23 |
{completed ? task.buttonLabels.completed : task.buttonLabels.notCompleted} |
| 24 |
</button> |
| 25 |
); |
| 26 |
}; |
| 27 |
|