mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-27 03:18:22 +03:00
16 lines
643 B
TypeScript
16 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>
|
|
);
|