feature/IO-3225-Notifications-1.5: Finish

This commit is contained in:
Dave Richer
2025-05-05 17:06:23 -04:00
parent 8109a12898
commit 5ba192eee0
9 changed files with 137 additions and 25 deletions

View File

@@ -0,0 +1,32 @@
// shop-info.notifications-autoadd.component.jsx
import React from "react";
import { Form, Typography } from "antd";
import { useTranslation } from "react-i18next";
import EmployeeSearchSelectComponent from "../employee-search-select/employee-search-select.component.jsx";
const { Text, Paragraph } = Typography;
export default function ShopInfoNotificationsAutoadd({ form, bodyshop }) {
const { t } = useTranslation();
const employeeOptions = bodyshop?.employees?.filter((e) => e.active && e.id) || [];
return (
<div>
<Paragraph>{t("bodyshop.fields.notifications.description")}</Paragraph>
<Text type="secondary">{t("bodyshop.labels.notifications.followers")}</Text>
{employeeOptions.length > 0 ? (
<Form.Item name="notification_followers" rules={[{ type: "array", message: t("general.validation.array") }]}>
<EmployeeSearchSelectComponent
style={{ minWidth: "100%" }}
mode="multiple"
options={employeeOptions}
placeholder={t("bodyshop.fields.notifications.placeholder")}
/>
</Form.Item>
) : (
<Text type="secondary">{t("bodyshop.fields.no_employees_available")}</Text>
)}
</div>
);
}