feat: implement text diff tool

This commit is contained in:
2024-05-14 22:26:00 +02:00
parent 5113fe626b
commit 91fe326261
10 changed files with 259 additions and 36 deletions

View File

@@ -2,3 +2,4 @@ export * from "./clear";
export * from "./copy";
export * from "./file";
export * from "./paste";
export * from "./toggle-full-size";

View File

@@ -0,0 +1,22 @@
import { memo } from "react";
import equal from "react-fast-compare";
import * as Icon from "@/components/icons";
import { Base, BaseProps } from "./base";
export type ToggleFullSizeProps = Omit<BaseProps, "icon" | "labelText"> & {
expanded: boolean;
};
function RawToggleFullSize({ expanded, ...props }: ToggleFullSizeProps) {
return (
<Base
{...props}
icon={expanded ? <Icon.Minimize size={16} /> : <Icon.Maximize size={16} />}
labelText={expanded ? "Collapse" : "Expand"}
/>
);
}
export const ToggleFullSize = memo(RawToggleFullSize, equal);