-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathdefault.ts
More file actions
43 lines (34 loc) · 1008 Bytes
/
default.ts
File metadata and controls
43 lines (34 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { FC } from 'react';
import type { OcticonProps } from '@primer/octicons-react';
import { QuestionIcon } from '@primer/octicons-react';
import {
type GitifyNotification,
type GitifySubject,
IconColor,
type Link,
type SettingsState,
type UserType,
} from '../../../types';
import type { NotificationTypeHandler } from './types';
export class DefaultHandler implements NotificationTypeHandler {
supportsMergedQueryEnrichment = false;
async enrich(
_notification: GitifyNotification,
_settings: SettingsState,
): Promise<Partial<GitifySubject>> {
return {};
}
iconType(_notification: GitifyNotification): FC<OcticonProps> {
return QuestionIcon;
}
iconColor(_notification: GitifyNotification): IconColor {
return IconColor.GRAY;
}
defaultUrl(notification: GitifyNotification): Link {
return notification.repository.htmlUrl;
}
defaultUserType(): UserType {
return 'User';
}
}
export const defaultHandler = new DefaultHandler();