Files
vscode/extensions/copilot/test/simulation/workbench/components/draggableBottomBorder.tsx
T
Matt Bierner 3c8134184b Enable no-unexternalized-strings in repo (#2448)
Enables the same `no-unexternalized-strings` with have in `vscode` in this repo. This make sure we have a more consistent style across repos and when generating edits
2025-12-05 18:45:12 +00:00

39 lines
1.2 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as React from 'react';
interface DraggableBottomBorderProps {
height: number;
setHeight: React.Dispatch<React.SetStateAction<number>>;
}
export const DraggableBottomBorder: React.FC<DraggableBottomBorderProps> = ({ height, setHeight }) => {
const handleMouseDown = (e: React.MouseEvent) => {
const startY = e.clientY;
const startHeight = height;
const handleMouseMove = (e: MouseEvent) => {
const newHeight = startHeight + (e.clientY - startY);
setHeight(newHeight);
};
const handleMouseUp = () => {
document.removeEventListener('mousemove', handleMouseMove);
document.removeEventListener('mouseup', handleMouseUp);
};
document.addEventListener('mousemove', handleMouseMove);
document.addEventListener('mouseup', handleMouseUp);
};
return (
<div
className='file-editor-draggable-border'
onMouseDown={handleMouseDown}
></div>
);
};