import { Section } from "../util/section"; import { Container } from "../util/container"; import { Icon } from "../util/icon"; import { iconSchema } from "../util/icon"; import { PageBlocksFeatures, PageBlocksFeaturesItems, } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; export const Feature = ({ featuresColor, data, }: { featuresColor: string; data: PageBlocksFeaturesItems; }) => { return (
{data.icon && ( )} {data.title && (

{data.title}

)} {data.text && (

{data.text}

)}
); }; export const Features = ({ data }: { data: PageBlocksFeatures }) => { return (
{data.items && data.items.map(function (block, i) { return ; })}
); }; const defaultFeature = { title: "Here's Another Feature", text: "This is where you might talk about the feature, if this wasn't just filler text.", icon: { color: "", style: "float", name: "", }, }; export const featureBlockSchema = { name: "features", label: "Features", ui: { previewSrc: "/blocks/features.png", defaultItem: { items: [defaultFeature, defaultFeature, defaultFeature], }, }, fields: [ { type: "object", label: "Feature Items", name: "items", list: true, ui: { itemProps: (item) => { return { label: item?.title, }; }, defaultItem: { ...defaultFeature, }, }, fields: [ iconSchema, { type: "string", label: "Title", name: "title", }, { type: "string", label: "Text", name: "text", ui: { component: "textarea", }, }, ], }, { type: "string", label: "Color", name: "color", options: [ { label: "Default", value: "default" }, { label: "Tint", value: "tint" }, { label: "Primary", value: "primary" }, ], }, ], };