Skip to content

Commit 92d4b56

Browse files
import useSheets to access firstRowIsHeaders state
modify rowNumbers with tenary to +1 or +2 to index depening on firstRowIsHeaders(true/false)
1 parent 0f38f7b commit 92d4b56

File tree

1 file changed

+6
-1
lines changed
  • src/features/import/components/ImportDialog/elements/ImportMessageList

1 file changed

+6
-1
lines changed

src/features/import/components/ImportDialog/elements/ImportMessageList/ImportMessage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import messageIds from 'features/import/l10n/messageIds';
1313
import ProblemRowsText from './ProblemRowsText';
1414
import { useMessages } from 'core/i18n';
15+
import useSheets from '../../../../hooks/useSheets';
1516

1617
type Props = {
1718
description?: string;
@@ -32,7 +33,11 @@ const ImportMessage: FC<Props> = ({
3233
}) => {
3334
const messages = useMessages(messageIds);
3435

35-
const rowNumbers = rowIndices?.map((rowIndex) => rowIndex + 1);
36+
const { firstRowIsHeaders } = useSheets();
37+
38+
const rowNumbers = rowIndices?.map((rowIndex) =>
39+
firstRowIsHeaders ? rowIndex + 2 : rowIndex + 1
40+
);
3641

3742
return (
3843
<Alert

0 commit comments

Comments
 (0)