2023-02-18 12:40:37 +03:00
|
|
|
import type { FC } from 'react';
|
2021-08-16 18:26:54 +03:00
|
|
|
import { DropdownItem } from 'reactstrap';
|
2023-07-24 21:14:59 +03:00
|
|
|
import { DropdownBtn } from '../../../../src/utils/DropdownBtn';
|
|
|
|
import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
|
2021-08-16 18:26:54 +03:00
|
|
|
|
|
|
|
interface QrFormatDropdownProps {
|
|
|
|
format: QrCodeFormat;
|
|
|
|
setFormat: (format: QrCodeFormat) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const QrFormatDropdown: FC<QrFormatDropdownProps> = ({ format, setFormat }) => (
|
|
|
|
<DropdownBtn text={`Format (${format})`}>
|
|
|
|
<DropdownItem active={format === 'png'} onClick={() => setFormat('png')}>PNG</DropdownItem>
|
|
|
|
<DropdownItem active={format === 'svg'} onClick={() => setFormat('svg')}>SVG</DropdownItem>
|
|
|
|
</DropdownBtn>
|
|
|
|
);
|