Move stuff belonging to the component to shlink-web-component

This commit is contained in:
Alejandro Celaya 2023-07-16 08:47:10 +02:00
parent cbbb679dfc
commit d82c0dc75e
204 changed files with 568 additions and 563 deletions
src/shlink-web-component/short-urls/helpers/qr-codes

View file

@ -0,0 +1,16 @@
import type { FC } from 'react';
import { DropdownItem } from 'reactstrap';
import { DropdownBtn } from '../../../../utils/DropdownBtn';
import type { 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>
);