This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useFormValue } from 'sanity' | |
| import { Flex, Badge, Inline } from '@sanity/ui' | |
| import { PortableTextBlock } from '@portabletext/types' | |
| export const WordCount = (props: any) => { | |
| const content = useFormValue(props.path) as PortableTextBlock[] | |
| const countWords = (blocks: PortableTextBlock[]): number => { | |
| if (!blocks) return 0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { type StructureBuilder } from "sanity/structure"; | |
| export const structure = (S: StructureBuilder) => { | |
| return S.list() | |
| .title("Content") | |
| .items([ | |
| S.listItem() | |
| .title("Home") | |
| .icon(INSERT_ICON_HERE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A11Y Image with alt | |
| const a11yImage = defineType({ | |
| name: 'a11yImage', | |
| title: 'A11y Image', | |
| type: 'object', | |
| fields: [ | |
| defineField({ | |
| name: 'shot', | |
| title: 'Shot', |