|
1
|
import { HttpTypes } from "@medusajs/types" |
|
2
|
import { Container, Heading } from "@medusajs/ui" |
|
3
|
|
|
4
|
import { PencilSquare } from "@medusajs/icons" |
|
5
|
import { useTranslation } from "react-i18next" |
|
6
|
import { ActionMenu } from "../../../../../components/common/action-menu" |
|
7
|
import { DateRangeDisplay } from "../../../../../components/common/date-range-display" |
|
8
|
|
|
9
|
type CampaignConfigurationSectionProps = { |
|
10
|
campaign: HttpTypes.AdminCampaign |
|
11
|
} |
|
12
|
|
|
13
|
export const CampaignConfigurationSection = ({ |
|
14
|
campaign, |
|
15
|
}: CampaignConfigurationSectionProps) => { |
|
16
|
const { t } = useTranslation() |
|
17
|
|
|
18
|
return ( |
|
19
|
<Container className="flex flex-col gap-y-4"> |
|
20
|
<div className="flex items-center justify-between"> |
|
21
|
<Heading level="h2">{t("campaigns.configuration.header")}</Heading> |
|
22
|
<ActionMenu |
|
23
|
groups={[ |
|
24
|
{ |
|
25
|
actions: [ |
|
26
|
{ |
|
27
|
label: t("actions.edit"), |
|
28
|
icon: <PencilSquare />, |
|
29
|
to: "configuration", |
|
30
|
}, |
|
31
|
], |
|
32
|
}, |
|
33
|
]} |
|
34
|
/> |
|
35
|
</div> |
|
36
|
<DateRangeDisplay |
|
37
|
startsAt={campaign.starts_at} |
|
38
|
endsAt={campaign.ends_at} |
|
39
|
showTime |
|
40
|
/> |
|
41
|
</Container> |
|
42
|
) |
|
43
|
} |