| 1 |
import { ActionButton } from '@assist/components/dashboard/buttons/ActionButton'; |
| 2 |
import { DismissButton } from '@assist/components/dashboard/buttons/DismissButton'; |
| 3 |
import { useTasksStore } from '@assist/state/tasks'; |
| 4 |
|
| 5 |
export const GenericCard = ({ task }) => { |
| 6 |
const { isCompleted, dismissTask } = useTasksStore(); |
| 7 |
|
| 8 |
return ( |
| 9 |
<div className="h-full justify-center overflow-hidden bg-white/95 text-base"> |
| 10 |
<div className="flex h-full flex-col items-center justify-center gap-5 p-7 text-center md:p-8"> |
| 11 |
{task?.htmlBefore()} |
| 12 |
|
| 13 |
<div className="flex h-full flex-col items-center justify-center text-center lg:justify-between"> |
| 14 |
<div> |
| 15 |
{task?.title && ( |
| 16 |
<h2 className="mb-2 text-2xl font-semibold leading-10 md:mt-0 lg:text-2xl"> |
| 17 |
{task.title} |
| 18 |
</h2> |
| 19 |
)} |
| 20 |
{task?.description && ( |
| 21 |
<p className="m-0 text-sm md:text-base">{task.description}</p> |
| 22 |
)} |
| 23 |
</div> |
| 24 |
<div className="cta mt-6 flex flex-wrap items-center text-sm md:gap-3 lg:mt-3"> |
| 25 |
<ActionButton task={task} /> |
| 26 |
{!isCompleted(task.slug) ? ( |
| 27 |
<DismissButton |
| 28 |
task={task} |
| 29 |
onClick={() => dismissTask(task.slug)} |
| 30 |
/> |
| 31 |
) : null} |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
</div> |
| 35 |
</div> |
| 36 |
); |
| 37 |
}; |
| 38 |
|