Download next.js/examples/cms-payload/payload/blocks/Media/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 870 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-payload/payload/blocks/Media/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-payload/payload/blocks/Media/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-payload/payload/blocks/Media/index.ts
870 Bytes
| import { Block } from "payload/types"; | |
| import { backgroundColor } from "../../fields/backgroundColor"; | |
| export const MediaBlock: Block = { | |
| slug: "mediaBlock", | |
| fields: [ | |
| { | |
| type: "row", | |
| fields: [ | |
| backgroundColor({ overrides: { name: "mediaBlockBackgroundColor" } }), | |
| { | |
| name: "position", | |
| type: "select", | |
| defaultValue: "default", | |
| options: [ | |
| { | |
| label: "Default", | |
| value: "default", | |
| }, | |
| { | |
| label: "Fullscreen", | |
| value: "fullscreen", | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| { | |
| name: "media", | |
| type: "upload", | |
| relationTo: "media", | |
| required: true, | |
| }, | |
| { | |
| name: "caption", | |
| type: "richText", | |
| admin: { | |
| elements: ["link"], | |
| }, | |
| }, | |
| ], | |
| }; | |