mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:13:51 +01:00
25 lines
564 B
TypeScript
25 lines
564 B
TypeScript
import { useRef } from 'react';
|
|
import { useMount } from 'react-use';
|
|
import { Button } from '../components/core/Button';
|
|
import { HStack } from '../components/core/Stacks';
|
|
|
|
interface Props {
|
|
hide: () => void;
|
|
}
|
|
export function Confirm({ hide }: Props) {
|
|
const focusRef = (el: HTMLButtonElement | null) => {
|
|
el?.focus();
|
|
};
|
|
|
|
return (
|
|
<HStack space={2} justifyContent="end">
|
|
<Button color="gray" onClick={hide}>
|
|
Cancel
|
|
</Button>
|
|
<Button ref={focusRef} color="primary">
|
|
Confirm
|
|
</Button>
|
|
</HStack>
|
|
);
|
|
}
|