import { TextField, ChoiceField } from '@hubspot/cms-components/fields';
import type { ContentFieldsProps } from './types.js';

const ContentFields = ({
  titleLabel = 'Title',
  titleName = 'title',
  titleDefault = 'Accordion Title',
  iconLabel = 'Icon',
  iconName = 'icon',
  iconDefault = 'chevron',
}: ContentFieldsProps) => {
  return (
    <>
      <ChoiceField
        label={iconLabel}
        name={iconName}
        display="buttons"
        choices={[
          ['chevron', 'Chevron'],
          ['plus', 'Plus'],
        ]}
        preset="expand_icon"
        required={false}
        default={iconDefault}
      />
      <TextField label={titleLabel} name={titleName} default={titleDefault} />
    </>
  );
};

export default ContentFields;
