Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions recipes/gmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,14 @@ const updateGmailFilterQuery = handler<
},
);

export default recipe<{ settings: Settings; auth: Auth }>(
export default recipe<{
settings: Default<Settings, {
gmailFilterQuery: "in:INBOX";
limit: 100;
historyId: "";
}>;
auth: Auth;
}>(
"gmail",
({ settings, auth }) => {
const emails = cell<Confidential<Email[]>>([]);
Expand All @@ -825,11 +832,18 @@ export default recipe<{ settings: Settings; auth: Auth }>(
derive(auth, (auth) => auth?.user?.email || "unauthorized")
}`,
[UI]: (
<div style="display: flex; gap: 10px; flex-direction: column; padding: 25px;">
<h2 style="font-size: 20px; font-weight: bold;">
<div
style={{
display: "flex",
gap: "10px",
flexDirection: "column",
padding: "25px",
}}
>
<h2 style={{ fontSize: "20px", fontWeight: "bold" }}>
{auth?.user?.email}
</h2>
<h2 style="font-size: 20px; font-weight: bold;">
<h2 style={{ fontSize: "20px", fontWeight: "bold" }}>
Imported email count: {derive(emails, (emails) => emails.length)}
</h2>

Expand Down Expand Up @@ -882,31 +896,37 @@ export default recipe<{ settings: Settings; auth: Auth }>(
<table>
<thead>
<tr>
<th style="padding: 10px;">DATE</th>
<th style="padding: 10px;">SUBJECT</th>
<th style="padding: 10px;">LABEL</th>
<th style="padding: 10px;">CONTENT</th>
<th style={{ padding: "10px" }}>DATE</th>
<th style={{ padding: "10px" }}>SUBJECT</th>
<th style={{ padding: "10px" }}>LABEL</th>
<th style={{ padding: "10px" }}>CONTENT</th>
</tr>
</thead>
<tbody>
{emails.map((email) => (
<tr>
<td style="border: 1px solid black; padding: 10px;">
<td style={{ border: "1px solid black", padding: "10px" }}>
&nbsp;{email.date}&nbsp;
</td>
<td style="border: 1px solid black; padding: 10px;">
<td style={{ border: "1px solid black", padding: "10px" }}>
&nbsp;{email.subject}&nbsp;
</td>
<td style="border: 1px solid black; padding: 10px;">
<td style={{ border: "1px solid black", padding: "10px" }}>
&nbsp;{derive(
email,
(email) => email?.labelIds?.join(", "),
)}&nbsp;
</td>
<td style="border: 1px solid black; padding: 10px;">
<td style={{ border: "1px solid black", padding: "10px" }}>
<details>
<summary>Show Markdown</summary>
<pre style="white-space: pre-wrap; max-height: 300px; overflow-y: auto;">
<pre
style={{
whiteSpace: "pre-wrap",
maxHeight: "300px",
overflowY: "auto",
}}
>
{email.markdownContent}
</pre>
</details>
Expand Down