import { GoogleMailNotificationListItem } from "./integrations/google-mail/listitem/GoogleMailNotificationListItem"; import { Action, ActionPanel, Detail, List, getPreferenceValues, openExtensionPreferences } from "@raycast/api"; import { GithubNotificationListItem } from "./integrations/github/listitem/GithubNotificationListItem"; import { LinearNotificationListItem } from "./integrations/linear/listitem/LinearNotificationListItem"; import { TodoistNotificationListItem } from "./integrations/todoist/TodoistNotificationListItem"; import { Notification, NotificationListItemProps } from "./notification"; import { NotificationActions } from "./action/NotificationActions"; import { Page, UniversalInboxPreferences } from "./types"; import { useFetch } from "@raycast/utils"; export default function Command() { const preferences = getPreferenceValues(); if ( preferences.apiKey === undefined || preferences.apiKey === "" || preferences.universalInboxBaseUrl === undefined || preferences.universalInboxBaseUrl === "" ) { return ( } /> ); } const { isLoading, data, mutate } = useFetch>( `${preferences.universalInboxBaseUrl}/api/notifications?status=Unread,Read&with_tasks=true`, { headers: { Authorization: `Bearer ${preferences.apiKey}`, }, }, ); return ( {data?.content.map((notification: Notification) => { return ; })} ); } function NotificationListItem({ notification, mutate }: NotificationListItemProps) { switch (notification.metadata.type) { case "Github": return ; case "Linear": return ; case "GoogleMail": return ; case "Todoist": return ; default: return ; } } function DefaultNotificationListItem({ notification, mutate }: NotificationListItemProps) { return ( } mutate={mutate} /> } /> ); }