Skip to content

Commit

Permalink
Improve file widget a bit (#95)
Browse files Browse the repository at this point in the history
Improve file upload
  • Loading branch information
eyurtsev committed Mar 22, 2024
1 parent a568f22 commit ecc4dfa
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions frontend/app/components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,22 @@ export const Playground = (props: PlaygroundProps) => {
</FormControl>
)}
{requestServerConfig.isFetched && (
<input
type="file"
name="file"
className="file-input"
accept={requestServerConfig.data?.accepted_mimetypes.join(", ")}
/>
<>
<input
type="file"
name="file"
accept={requestServerConfig.data?.accepted_mimetypes.join(", ")}
color="blue"
className="border-2 border-dashed border-gray-300 rounded-md p-4 w-full file:mr-4"
/>
<Text fontSize="xs">
Max file size is: {requestServerConfig.data?.max_file_size_mb}MB
</Text>
<Text fontSize="xs">
Supported mimetypes:{" "}
{requestServerConfig.data?.accepted_mimetypes.join(", ")}
</Text>
</>
)}
<Box position="relative" padding="10">
<Divider />
Expand Down

0 comments on commit ecc4dfa

Please sign in to comment.