* feat: wip import csv * feat: start implementing twenty UI * feat: new radio button component * feat: use new radio button component and fix scroll issue * fix: max height modal * feat: wip try to customize react-data-grid to match design * feat: wip match columns * feat: wip match column selection * feat: match column * feat: clean heading component & try to fix scroll in last step * feat: validation step * fix: small cleaning and remove unused component * feat: clean folder architecture * feat: remove translations * feat: remove chackra theme * feat: remove unused libraries * feat: use option button to open spreadsheet & fix stories * Fix lint and fix imports --------- Co-authored-by: Charles Bochet <charles@twenty.com>
29 lines
859 B
TypeScript
29 lines
859 B
TypeScript
import type { RsiProps } from '../types';
|
|
|
|
import { ModalWrapper } from './core/ModalWrapper';
|
|
import { Providers } from './core/Providers';
|
|
import { Steps } from './steps/Steps';
|
|
|
|
export const defaultRSIProps: Partial<RsiProps<any>> = {
|
|
autoMapHeaders: true,
|
|
allowInvalidSubmit: true,
|
|
autoMapDistance: 2,
|
|
uploadStepHook: async (value) => value,
|
|
selectHeaderStepHook: async (headerValues, data) => ({ headerValues, data }),
|
|
matchColumnsStepHook: async (table) => table,
|
|
dateFormat: 'yyyy-mm-dd', // ISO 8601,
|
|
parseRaw: true,
|
|
} as const;
|
|
|
|
export const SpreadsheetImport = <T extends string>(props: RsiProps<T>) => {
|
|
return (
|
|
<Providers rsiValues={props}>
|
|
<ModalWrapper isOpen={props.isOpen} onClose={props.onClose}>
|
|
<Steps />
|
|
</ModalWrapper>
|
|
</Providers>
|
|
);
|
|
};
|
|
|
|
SpreadsheetImport.defaultProps = defaultRSIProps;
|