mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
initial commit
This commit is contained in:
25
src/SelectFile.tsx
Normal file
25
src/SelectFile.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Box, Stack, Text } from '@chakra-ui/react';
|
||||
import { UnlockIcon } from '@chakra-ui/icons';
|
||||
import { useId } from 'react';
|
||||
import { PointerLabel } from './PointerLabel';
|
||||
|
||||
export function SelectFile() {
|
||||
const id = useId();
|
||||
|
||||
return (
|
||||
<Box borderWidth="1px" borderRadius="lg" p="6">
|
||||
<Stack alignItems="center">
|
||||
<UnlockIcon />
|
||||
<Box>
|
||||
将文件拖到此处,或
|
||||
<PointerLabel htmlFor={id}>
|
||||
<Text as="span" color="teal.400">
|
||||
点击选择
|
||||
</Text>
|
||||
</PointerLabel>
|
||||
<input id={id} type="file" hidden multiple />
|
||||
</Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user