Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/app/components/AutoResponder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
SelectedDay,
SettingsData,
} from '@/constants';
import { InternalUser, InternalUsers } from '@/types/common';
import { InternalUser, InternalUsers, WorkspaceResponse } from '@/types/common';
import { MenuItem, Select, SelectChangeEvent } from '@mui/material';

const defaultSelectedDays: SelectedDay[] = [
Expand Down Expand Up @@ -60,6 +60,7 @@
onSave(data: SettingsData): Promise<void>;
activeSettings: SettingsData;
internalUsers: InternalUsers;
workspace?: WorkspaceResponse;
}

const DropdownIndicator = (props: DropdownIndicatorProps<ITimezone, false, GroupBase<ITimezone>>) => {
Expand Down Expand Up @@ -153,7 +154,7 @@
senderId: z.string().uuid().nullable(),
});

const AutoResponder = ({ onSave, activeSettings, internalUsers }: Props) => {
const AutoResponder = ({ onSave, activeSettings, internalUsers, workspace }: Props) => {
const defaultFormValues = useRef(activeSettings);
const [saving, setSaving] = useState(false);
const [workingHoursErrors, setWorkingHoursErrors] = useState<Record<number, string>>({});
Expand Down Expand Up @@ -206,7 +207,7 @@
});
}
}
}, [autoRespond]);

Check warning on line 210 in src/app/components/AutoResponder.tsx

View workflow job for this annotation

GitHub Actions / Run linters

React Hook useEffect has missing dependencies: 'isDirty' and 'setValue'. Either include them or remove the dependency array

const toggleSelectedDay = (day: DAY_VALUE) => {
const selectedDayIndex = selectedDays.fields.findIndex((selectedDay) => selectedDay.day === day);
Expand Down Expand Up @@ -293,7 +294,9 @@
<div className="w-full max-w-[880px] mx-auto">
<Fieldset
title="Auto-responder configuration"
info="Set up an automatic response to incoming messages in the Messages App. If clients send you several messages, auto-response will be sent at most once every hour (per message channel)."
info={`Set up an automatic response to incoming messages in the Messages App. If ${
workspace?.labels?.individualTermPlural?.toLowerCase() || 'clients'
} send you several messages, auto-response will be sent at most once every hour (per message channel).`}
>
<Typography text="Enable auto response" variant="label" className="mb-1.5 text-text" />
<Controller
Expand Down
1 change: 1 addition & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default async function Page({ searchParams }: { searchParams: SearchParam
...populateSettingsFormData(setting as SettingResponse, currentUserId),
}}
internalUsers={internalUsersWithClientAccessLimitedFalse}
workspace={workspace}
/>
</main>
);
Expand Down
5 changes: 5 additions & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const WorkspaceResponseSchema = z.object({
font: z.string().optional(),
metaTitle: z.string().optional(),
metaDescription: z.string().optional(),
labels: z
.object({
individualTermPlural: z.string().optional(),
})
.optional(),
});
export type WorkspaceResponse = z.infer<typeof WorkspaceResponseSchema>;

Expand Down