import { List, Datagrid, TextField, ReferenceField, NumberField, EditButton, Create, SimpleForm, TextInput, NumberInput, ReferenceInput, SelectInput, Edit, CheckboxGroupInput, ArrayField, ChipField, SingleFieldList, BooleanField, FunctionField, } from 'react-admin'; import { Typography, Box, Chip, Tooltip, IconButton } from '@mui/material'; import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; const COUPLE_GENDER_CHOICES = [ { id: 'male+female', name: 'Male + Female' }, { id: 'male+male', name: 'Male + Male' }, { id: 'female+female', name: 'Female + Female' }, ]; const TARGET_USER_GENDER_CHOICES = [ { id: 'male', name: 'Male' }, { id: 'female', name: 'Female' }, { id: 'non-binary', name: 'Non-binary' }, { id: 'prefer-not-to-say', name: 'Prefer not to say' }, ]; const LabelWithTooltip = ({ label, tooltip }: { label: string; tooltip: string }) => ( {label} ); const GenderChips = ({ record, source }: { record?: any; source: string }) => { const values = record?.[source]; if (!values || values.length === 0) { return ; } return ( {values.map((v: string) => ( ))} ); }; export const QuestionList = () => ( record?.partner_text ? 'Yes' : 'No'} /> { const values = record?.target_user_genders; if (!values || values.length === 0) return 'All'; return values.join(', '); }} /> ); const QuestionForm = () => ( Question Text Targeting } choices={TARGET_USER_GENDER_CHOICES} helperText="Leave empty to show to all genders as initiator." /> } choices={COUPLE_GENDER_CHOICES} helperText="Leave empty to show to all couple types." /> ); export const QuestionEdit = () => ( ); export const QuestionCreate = () => ( );