feat: add missing integrations and rich notification previews
Add TickTick, Google Calendar, Google Drive and API (WebPage) notification types, which the backend already supported but the extension ignored. Fill the previously empty notification previews with content modeled on the web app: a metadata sidebar (status, priority, assignee, labels, dates, channel, etc.) plus a markdown body and comment/message threads. Add shared helpers: PreviewDetail wrapper, TaskMetadata, Slack mrkdwn renderer, GitHub check/review emoji, and date/HTML utils (cleanHtml strips raw HTML from GitHub bodies). The preview metadata "Type" row shows the source item type (Linear Issue, GitHub Pull Request, Slack Thread, etc.). Swap list-screen shortcuts: Enter shows details, Cmd+Enter opens in browser.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { APINotificationPreview } from "../preview/APINotificationPreview";
|
||||
import { NotificationActions } from "../../../action/NotificationActions";
|
||||
import { NotificationListItemProps } from "../../../notification";
|
||||
import { Icon, List } from "@raycast/api";
|
||||
import { WebPage } from "../types";
|
||||
|
||||
export function APINotificationListItem({ notification, mutate }: NotificationListItemProps) {
|
||||
if (notification.source_item.data.type !== "WebPage") return null;
|
||||
|
||||
const webPage: WebPage = notification.source_item.data.content;
|
||||
|
||||
const accessories: List.Item.Accessory[] = [
|
||||
{
|
||||
date: new Date(notification.updated_at),
|
||||
tooltip: `Updated at ${notification.updated_at}`,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List.Item
|
||||
key={notification.id}
|
||||
title={notification.title}
|
||||
icon={Icon.Globe}
|
||||
subtitle={webPage.url}
|
||||
accessories={accessories}
|
||||
actions={
|
||||
<NotificationActions
|
||||
notification={notification}
|
||||
detailsTarget={<APINotificationPreview notification={notification} webPage={webPage} />}
|
||||
mutate={mutate}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user