mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-17 06:29:15 -04:00
* beginnings of app directory * settings mostly good * colocate way more components * flatten components folder * reexport QueryClientProvider from client * move CodeBlock back to interface * colocate Explorer, KeyManager + more * goddamn captialisation * get toasts out of components * please eslint * no more src directory * $ instead of : * added back RowHeader component * fix settings modal padding * more spacing, less margin * fix sidebar locations button * fix tags sidebar link * clean up back button * added margin to explorer context menu to prevent contact with edge of viewport * don't export QueryClientProvider from @sd/client * basic guidelines * import interface correctly * remove old demo data * fix onboarding layout * fix onboarding navigation * fix key manager settings button --------- Co-authored-by: Jamie Pine <ijamespine@me.com>
14 lines
484 B
TypeScript
14 lines
484 B
TypeScript
import { ExplorerItem, ObjectKind, isObject, isPath } from '@sd/client';
|
|
|
|
export function getExplorerItemData(data: ExplorerItem) {
|
|
const objectData = data ? (isObject(data) ? data.item : data.item.object) : null;
|
|
|
|
return {
|
|
cas_id: (isObject(data) ? data.item.file_paths[0]?.cas_id : data.item.cas_id) || null,
|
|
isDir: isPath(data) && data.item.is_dir,
|
|
kind: ObjectKind[objectData?.kind || 0] || null,
|
|
hasThumbnail: data.has_thumbnail,
|
|
extension: data.item.extension
|
|
};
|
|
}
|