attio 0.0.1-experimental.20250311 → 0.0.1-experimental.20250321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +0,0 @@
1
- import React from "react"
2
- import {TextBlock, useAsyncCache} from "attio/client"
3
- import getAdvice from "./get-advice.server"
4
-
5
- export function Advice({recordId}: {recordId: string}) {
6
- // By passing in the recordId, the result will be cached for each recordId
7
- const {
8
- values: {advice},
9
- // ^^^^^^– this key matches
10
- // vvvvvv– this key
11
- } = useAsyncCache({advice: [getAdvice, recordId]})
12
- // ^^^^^^^^^ ^^^^^^^^
13
- // async fn parameter(s)
14
-
15
- return <TextBlock align="center">{`"${advice}"`}</TextBlock>
16
- }
@@ -1,6 +0,0 @@
1
- export default async function getAdvice(recordId: string): Promise<string> {
2
- // We don't really need the recordId for this API, but this is how we could use a parameter
3
- const response = await fetch(`https://api.adviceslip.com/advice?${recordId}`)
4
- const data = await response.json()
5
- return data.slip.advice
6
- }