Raw
1 import { CodeBlock, Label } from "@medusajs/ui"
2
3 const snippets = [
4 {
5 label: "cURL",
6 language: "bash",
7 code: `curl 'http://localhost:9000/store/products/PRODUCT_ID'\n -H 'x-publishable-key: YOUR_API_KEY'`,
8 hideLineNumbers: true,
9 },
10 {
11 label: "Medusa JS SDK",
12 language: "jsx",
13 code: `const { product } = await medusa.store.products.retrieve("prod_123")\nconsole.log(product.id)`,
14 },
15 ]
16
17 export default function CodeBlockDemo() {
18 return (
19 <div className="w-full">
20 <CodeBlock snippets={snippets}>
21 <CodeBlock.Header>
22 <CodeBlock.Header.Meta>
23 <Label weight={"plus"}>/product-detail.js</Label>
24 </CodeBlock.Header.Meta>
25 </CodeBlock.Header>
26 <CodeBlock.Body />
27 </CodeBlock>
28 </div>
29 )
30 }