mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-16 00:25:25 -05:00
43 lines
988 B
TypeScript
43 lines
988 B
TypeScript
import { Box } from '@chakra-ui/react';
|
|
|
|
type Props = {
|
|
isSelected: boolean;
|
|
isHovered: boolean;
|
|
};
|
|
const SelectionOverlay = ({ isSelected, isHovered }: Props) => {
|
|
return (
|
|
<Box
|
|
className="selection-box"
|
|
sx={{
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineEnd: 0,
|
|
bottom: 0,
|
|
insetInlineStart: 0,
|
|
borderRadius: 'base',
|
|
opacity: isSelected ? 1 : 0.7,
|
|
transitionProperty: 'common',
|
|
transitionDuration: '0.1s',
|
|
shadow: isSelected
|
|
? isHovered
|
|
? 'hoverSelected.light'
|
|
: 'selected.light'
|
|
: isHovered
|
|
? 'hoverUnselected.light'
|
|
: undefined,
|
|
_dark: {
|
|
shadow: isSelected
|
|
? isHovered
|
|
? 'hoverSelected.dark'
|
|
: 'selected.dark'
|
|
: isHovered
|
|
? 'hoverUnselected.dark'
|
|
: undefined,
|
|
},
|
|
}}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default SelectionOverlay;
|