Files
spacedrive/interface/app/$libraryId/settings/node/libraries/index.tsx
Vítor Vasconcellos 50442ede3e [ENG-469] Make Prettier and ESLint work together (#706)
* Make Prettier and ESLint work together
- Resolve conflicts between Prettier and ESLint regarding indentation and Tailwind rules order
- Add `.editorconfig` to standardize basic formatting options across tools and editors
- Add `.gitattributes` to hide `pnpm-lock.yaml` in `git diff` output
- Include EditorConfig in the recommended extensions for VSCode
- Replace some instances of `pnpm exec <command>` with `pnpm <command>`
- Remove superfluous Tauri config for Linux

* Revert Prettier changes (it was working correctly before)
 - Update ESLint to read Tailwind config from absolute path
 - Remove redundant Prettier dependency from subprojects
 - Specify the source folder for the lint script in subprojects

* use mobile's tailwind config with eslint

* pnpm format + pnpm lint:fix

---------

Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
2023-04-14 21:21:21 +00:00

50 lines
1.1 KiB
TypeScript

import { useBridgeQuery, useLibraryContext } from '@sd/client';
import { Button, dialogManager } from '@sd/ui';
import { Heading } from '../../Layout';
import CreateDialog from './CreateDialog';
import ListItem from './ListItem';
export const Component = () => {
const libraries = useBridgeQuery(['library.list']);
const { library } = useLibraryContext();
return (
<>
<Heading
title="Libraries"
description="The database contains all library data and file metadata."
rightArea={
<div className="flex-row space-x-2">
<Button
variant="accent"
size="sm"
onClick={() => {
dialogManager.create((dp) => <CreateDialog {...dp} />);
}}
>
Add Library
</Button>
</div>
}
/>
<div className="space-y-2">
{libraries.data
?.sort((a, b) => {
if (a.uuid === library.uuid) return -1;
if (b.uuid === library.uuid) return 1;
return 0;
})
.map((lib) => (
<ListItem
current={lib.uuid === library.uuid}
key={lib.uuid}
library={lib}
/>
))}
</div>
</>
);
};