Fixes #11136 [recording.webm](https://github.com/user-attachments/assets/328afab8-511a-4090-bdb0-e1cdb42565be)
98 lines
3.4 KiB
TypeScript
98 lines
3.4 KiB
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import { EventRowActivity } from '@/activities/timeline-activities/rows/activity/components/EventRowActivity';
|
|
import { EventRowCalendarEvent } from '@/activities/timeline-activities/rows/calendar/components/EventRowCalendarEvent';
|
|
import { EventRowMainObject } from '@/activities/timeline-activities/rows/main-object/components/EventRowMainObject';
|
|
import { EventRowMessage } from '@/activities/timeline-activities/rows/message/components/EventRowMessage';
|
|
import { TimelineActivity } from '@/activities/timeline-activities/types/TimelineActivity';
|
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
|
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
|
|
|
export interface EventRowDynamicComponentProps {
|
|
labelIdentifierValue: string;
|
|
event: TimelineActivity;
|
|
mainObjectMetadataItem: ObjectMetadataItem;
|
|
linkedObjectMetadataItem: ObjectMetadataItem | null;
|
|
authorFullName: string;
|
|
createdAt?: string;
|
|
}
|
|
|
|
export const StyledEventRowItemColumn = styled.div`
|
|
align-items: center;
|
|
color: ${({ theme }) => theme.font.color.primary};
|
|
display: flex;
|
|
flex-direction: row;
|
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
`;
|
|
|
|
export const StyledEventRowItemAction = styled(StyledEventRowItemColumn)`
|
|
color: ${({ theme }) => theme.font.color.secondary};
|
|
`;
|
|
|
|
export const EventRowDynamicComponent = ({
|
|
labelIdentifierValue,
|
|
event,
|
|
mainObjectMetadataItem,
|
|
linkedObjectMetadataItem,
|
|
authorFullName,
|
|
createdAt,
|
|
}: EventRowDynamicComponentProps) => {
|
|
switch (linkedObjectMetadataItem?.nameSingular) {
|
|
case 'calendarEvent':
|
|
return (
|
|
<EventRowCalendarEvent
|
|
labelIdentifierValue={labelIdentifierValue}
|
|
event={event}
|
|
mainObjectMetadataItem={mainObjectMetadataItem}
|
|
linkedObjectMetadataItem={linkedObjectMetadataItem}
|
|
authorFullName={authorFullName}
|
|
/>
|
|
);
|
|
case 'message':
|
|
return (
|
|
<EventRowMessage
|
|
labelIdentifierValue={labelIdentifierValue}
|
|
event={event}
|
|
mainObjectMetadataItem={mainObjectMetadataItem}
|
|
linkedObjectMetadataItem={linkedObjectMetadataItem}
|
|
authorFullName={authorFullName}
|
|
/>
|
|
);
|
|
case 'task':
|
|
return (
|
|
<EventRowActivity
|
|
labelIdentifierValue={labelIdentifierValue}
|
|
event={event}
|
|
mainObjectMetadataItem={mainObjectMetadataItem}
|
|
linkedObjectMetadataItem={linkedObjectMetadataItem}
|
|
authorFullName={authorFullName}
|
|
objectNameSingular={CoreObjectNameSingular.Task}
|
|
createdAt={createdAt}
|
|
/>
|
|
);
|
|
case 'note':
|
|
return (
|
|
<EventRowActivity
|
|
labelIdentifierValue={labelIdentifierValue}
|
|
event={event}
|
|
mainObjectMetadataItem={mainObjectMetadataItem}
|
|
linkedObjectMetadataItem={linkedObjectMetadataItem}
|
|
authorFullName={authorFullName}
|
|
objectNameSingular={CoreObjectNameSingular.Note}
|
|
createdAt={createdAt}
|
|
/>
|
|
);
|
|
default:
|
|
return (
|
|
<EventRowMainObject
|
|
labelIdentifierValue={labelIdentifierValue}
|
|
event={event}
|
|
mainObjectMetadataItem={mainObjectMetadataItem}
|
|
linkedObjectMetadataItem={linkedObjectMetadataItem}
|
|
authorFullName={authorFullName}
|
|
createdAt={createdAt}
|
|
/>
|
|
);
|
|
}
|
|
};
|