mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-27 19:38:32 +03:00
17 lines
643 B
TypeScript
17 lines
643 B
TypeScript
|
import { FC } from 'react';
|
||
|
import { DropdownItem } from 'reactstrap';
|
||
|
import { DropdownBtn } from '../../../utils/DropdownBtn';
|
||
|
import { QrCodeFormat } from '../../../utils/helpers/qrCodes';
|
||
|
|
||
|
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>
|
||
|
);
|