diff --git a/src/pages/editor.tsx b/src/pages/editor.tsx index 83b2d7d..7efadfd 100644 --- a/src/pages/editor.tsx +++ b/src/pages/editor.tsx @@ -138,22 +138,22 @@ export default function Editor() { onError: (m) => setPageError(m), }); - const colWidth = useMemo(() => `${100 / (languages.length + 2)}%`, [languages.length]); + const tableWidth = useMemo(() => (languages.length * 200) + 36 + 60 + 200, [languages.length]); const virtuosoComponents = useMemo(() => ({ - Table: (props: React.TableHTMLAttributes) => , + Table: ({ style, ...props }: React.TableHTMLAttributes) =>
, TableHead: (props: React.HTMLAttributes) => , TableRow: (props: React.HTMLAttributes) => , TableBody: (props: React.HTMLAttributes) => , TableFoot: (props: React.HTMLAttributes) => , - }), []); + }), [tableWidth]); const allSelected = useMemo(() => entries.length > 0 && selected.size === entries.length, [entries, selected]); const MAX_AI_ITEMS = 50; const headerContent = useCallback(() => ( - {languages.map((lang) => ( - + ))} - + - ), [languages, colWidth, allSelected, entries]); + ), [languages, allSelected, entries]); const renderItemContent = useCallback((_idx: number, entry: FlatEntry) => { const handleCopy = () => { @@ -181,7 +181,7 @@ export default function Editor() { return ( <> - - ); - }, [languages, colWidth, inline, projectId, structure, setStructure, setValuesByLang, copy]); + }, [languages, inline, projectId, structure, setStructure, setValuesByLang, copy]); useEffect(() => { if (!projectId || languages.length === 0) return;
+ { @@ -167,11 +167,11 @@ export default function Editor() { 翻译条目名称{lang}{lang}操作操作
+ { @@ -193,7 +193,7 @@ export default function Editor() { }} /> + @@ -203,7 +203,7 @@ export default function Editor() { const isSaving = inline.isSavingCell(entry.path, lang); const displayValue = inline.getDisplayValue(entry.path, lang); return ( - + {isEditing ? ( ); })} - +