Skip to content

Commit

Permalink
add type
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace committed Aug 13, 2024
1 parent 2e2f5ac commit 42779b0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions seeder/src/renderer/routes/staff/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CommandInitializer from "@renderer/components/CommandInitializer";
import { Component } from "solid-js";
import { diffLines } from "diff";
import { Change, diffLines } from "diff";

// MOCK data
const staff_db = {
Expand Down Expand Up @@ -38,18 +38,16 @@ const Staff: Component = () => {
console.log(e.detail);
};

// const diffResult = diffJson(staff_db, staff_mal)
// console.log(diffResult)
const diff = {
const diff: {
[key: string]: Change[];
} = {
name: diffLines(staff_db.name, staff_mal.name),
given_name: diffLines(staff_db.given_name, staff_mal.given_name),
family_name: diffLines(staff_db.family_name, staff_mal.family_name),
alternate_name: diffLines(staff_db.alternate_name.join(", "), staff_mal.alternate_name.join(", ")),
about: diffLines(staff_db.about, staff_mal.about),
};

console.log(diff)

const renderDiff = (field: string, type: "old" | "new") => {
return (
<div class="flex flex-col gap-1">
Expand Down

0 comments on commit 42779b0

Please sign in to comment.