for the most part switched out the grid's internals for the new table component

This commit is contained in:
Chris Kruining 2024-12-11 16:24:54 +01:00
parent 6d74950495
commit d219ae1f9a
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
8 changed files with 151 additions and 218 deletions

View file

@ -105,6 +105,8 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
const files = tab.files();
const mutations = tab.api()?.mutations() ?? [];
// console.log(mutations);
return mutations.flatMap(m => {
switch (m.kind) {
case MutarionKind.Update: {
@ -433,7 +435,7 @@ const Content: Component<{ directory: FileSystemDirectoryHandle, api?: Setter<Gr
return aggregate;
}, new Map<string, Record<string, { id: string, value: string, handle: FileSystemFileHandle }>>());
setColumns(['key', ...languages]);
setColumns(languages.values().toArray());
setEntries(merged);
setRows(new Map(merged.entries().map(([key, langs]) => [key, Object.fromEntries(Object.entries(langs).map(([lang, { value }]) => [lang, value]))] as const)));
})();