Files
outline/app/components/DropzoneContainer.tsx
Tom MoorandClaude Opus 5 8b35f7bd17 feat: Import file dialog (#13228)
* feat: Replace import document file picker with a modal

Choosing "Import document" now opens a dialog that lists the supported
file formats with an icon for each, and accepts files either dropped onto
it or chosen with the system file picker.

Also closes the gaps between the formats the dialog advertises and those
the importer actually accepts:

- `.tsv` was offered by the file picker but rejected by the server, it is
  now converted to a table like CSV
- `.csv` and `.htm` are now recognised by extension, so they still import
  when the browser reports an unhelpful mime type
- `.markdown` is now offered by the file picker, it was already supported

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dj1UnjnRX336CQcdzw3ott

* Add intermediate dialog for file import

* tweaks, polish

* Update failure message

* test

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-01 17:46:47 -04:00

36 lines
898 B
TypeScript

import styled, { css } from "styled-components";
import { hover, s } from "@shared/styles";
/**
* A dashed drop target for choosing files, highlighted while a file is dragged
* over it.
*/
export const DropzoneContainer = styled.div<{
$isDragActive: boolean;
$disabled?: boolean;
}>`
background: ${(props) =>
props.$isDragActive
? props.theme.backgroundSecondary
: props.theme.background};
border-radius: 8px;
border: 1px dashed ${s("divider")};
padding: 44px 24px;
text-align: center;
font-size: 15px;
cursor: var(--pointer);
opacity: ${(props) => (props.$disabled ? 0.5 : 1)};
&: ${hover} {
background: ${s("backgroundSecondary")};
}
`;
/** Styles the icon shown inside a dropzone as a colored badge. */
export const dropzoneIcon = css`
padding: 4px;
border-radius: 50%;
background: ${(props) => props.theme.brand.blue};
color: white;
`;