mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-17 04:59:23 +00:00
feat: implement text diff tool
This commit is contained in:
@@ -2,3 +2,4 @@ export * from "./clear";
|
||||
export * from "./copy";
|
||||
export * from "./file";
|
||||
export * from "./paste";
|
||||
export * from "./toggle-full-size";
|
||||
|
||||
22
components/buttons/toggle-full-size.tsx
Normal file
22
components/buttons/toggle-full-size.tsx
Normal 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);
|
||||
Reference in New Issue
Block a user