mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-08 09:24:41 +00:00
15 lines
442 B
JavaScript
15 lines
442 B
JavaScript
import { dialog, promises } from "@react-native-gpui/fs";
|
|
export async function getDocumentAsync(options = {}) {
|
|
const paths = await dialog.open({ multiple: options.multiple ?? false });
|
|
return {
|
|
canceled: paths.length === 0,
|
|
assets: await Promise.all(
|
|
paths.map(async (path) => ({
|
|
uri: `file://${path}`,
|
|
name: path.split("/").at(-1),
|
|
size: (await promises.stat(path)).size,
|
|
})),
|
|
),
|
|
};
|
|
}
|