* chore: set up twenty-emails config so build isn't needed in development * fix: fix script dependency * chore: use @vitejs/plugin-react-swc * Remove useless dependancy * Fix typing * chore: use baseUrl in twenty-emails * chore: fix docker server prod build * refactor: optimize Docker file and tsconfig * fix: fix WORKDIR in docker --------- Co-authored-by: martmull <martmull@hotmail.fr>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { Column, Row, Section } from '@react-email/components';
|
|
import { BaseEmail } from 'src/components/BaseEmail';
|
|
import { MainText } from 'src/components/MainText';
|
|
import { Title } from 'src/components/Title';
|
|
|
|
type DeleteInactiveWorkspaceEmailData = {
|
|
daysSinceInactive: number;
|
|
workspaceId: string;
|
|
};
|
|
|
|
export const DeleteInactiveWorkspaceEmail = (
|
|
workspacesToDelete: DeleteInactiveWorkspaceEmailData[],
|
|
) => {
|
|
const minDaysSinceInactive = Math.min(
|
|
...workspacesToDelete.map(
|
|
(workspaceToDelete) => workspaceToDelete.daysSinceInactive,
|
|
),
|
|
);
|
|
return (
|
|
<BaseEmail width={350}>
|
|
<Title value="Dead Workspaces 😵 that should be deleted" />
|
|
<MainText>
|
|
List of <b>workspaceIds</b> inactive since at least{' '}
|
|
<b>{minDaysSinceInactive} days</b>:
|
|
<Section>
|
|
{workspacesToDelete.map((workspaceToDelete) => {
|
|
return (
|
|
<Row key={workspaceToDelete.workspaceId}>
|
|
<Column>{workspaceToDelete.workspaceId}</Column>
|
|
</Row>
|
|
);
|
|
})}
|
|
</Section>
|
|
</MainText>
|
|
</BaseEmail>
|
|
);
|
|
};
|
|
|
|
export default DeleteInactiveWorkspaceEmail;
|