mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
sec
This commit is contained in:
26
src/components/encrypt/Add.tsx
Normal file
26
src/components/encrypt/Add.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Radio, Divider } from 'antd';
|
||||
import { FileOutlined, FileTextOutlined } from '@ant-design/icons';
|
||||
import AddText from './AddText';
|
||||
import AddFile from './AddFile';
|
||||
|
||||
const DEFAULT_VALUE = 'text';
|
||||
|
||||
const Add: React.FC = () => {
|
||||
const [type, setType] = useState<'file' | 'text'>(DEFAULT_VALUE);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Divider>
|
||||
<Radio.Group onChange={evt => setType(evt.target.value)} defaultValue={DEFAULT_VALUE}>
|
||||
<Radio.Button value="text"><FileTextOutlined /> Text</Radio.Button>
|
||||
<Radio.Button value="file"><FileOutlined /> File</Radio.Button>
|
||||
</Radio.Group>
|
||||
</Divider>
|
||||
{type === 'text' && <AddText />}
|
||||
{type === 'file' && <AddFile />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Add;
|
||||
Reference in New Issue
Block a user