mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-09 05:44:01 +00:00
restructure files onto electron-vite boilerplate
This commit is contained in:
parent
91ce2cd8a1
commit
1cf587bc8f
457 changed files with 9927 additions and 11705 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import { Group, Table } from '@mantine/core';
|
||||
import { RiCheckFill, RiCloseFill } from 'react-icons/ri';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import { ReactNode } from 'react';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import { RiCheckFill, RiCloseFill } from 'react-icons/ri';
|
||||
import { generatePath } from 'react-router';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import {
|
||||
Album,
|
||||
AlbumArtist,
|
||||
|
|
@ -10,18 +13,16 @@ import {
|
|||
RelatedArtist,
|
||||
Song,
|
||||
} from '/@/renderer/api/types';
|
||||
import { formatDurationString, formatSizeString } from '/@/renderer/utils';
|
||||
import { replaceURLWithHTMLLinks } from '/@/renderer/utils/linkify';
|
||||
import { Spoiler, Text } from '/@/renderer/components';
|
||||
import { sanitize } from '/@/renderer/utils/sanitize';
|
||||
import { SongPath } from '/@/renderer/features/item-details/components/song-path';
|
||||
import { generatePath } from 'react-router';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import { Separator } from '/@/renderer/components/separator';
|
||||
import { useGenreRoute } from '/@/renderer/hooks/use-genre-route';
|
||||
import { formatDateRelative, formatRating } from '/@/renderer/utils/format';
|
||||
import { SEPARATOR_STRING } from '/@/renderer/api/utils';
|
||||
import { Spoiler, Text } from '/@/renderer/components';
|
||||
import { Separator } from '/@/renderer/components/separator';
|
||||
import { SongPath } from '/@/renderer/features/item-details/components/song-path';
|
||||
import { useGenreRoute } from '/@/renderer/hooks/use-genre-route';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import { formatDurationString, formatSizeString } from '/@/renderer/utils';
|
||||
import { formatDateRelative, formatRating } from '/@/renderer/utils/format';
|
||||
import { replaceURLWithHTMLLinks } from '/@/renderer/utils/linkify';
|
||||
import { sanitize } from '/@/renderer/utils/sanitize';
|
||||
|
||||
export type ItemDetailsModalProps = {
|
||||
item: Album | AlbumArtist | Song;
|
||||
|
|
@ -54,7 +55,7 @@ const handleRow = <T extends AnyLibraryItem>(t: TFunction, item: T, rule: ItemDe
|
|||
);
|
||||
};
|
||||
|
||||
const formatArtists = (artists: RelatedArtist[] | undefined | null) =>
|
||||
const formatArtists = (artists: null | RelatedArtist[] | undefined) =>
|
||||
artists?.map((artist, index) => (
|
||||
<span key={artist.id || artist.name}>
|
||||
{index > 0 && <Separator />}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ import { ActionIcon, CopyButton, Group } from '@mantine/core';
|
|||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { RiCheckFill, RiClipboardFill, RiExternalLinkFill } from 'react-icons/ri';
|
||||
import { Tooltip, toast } from '/@/renderer/components';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const util = isElectron() ? window.electron.utils : null;
|
||||
import { toast, Tooltip } from '/@/renderer/components';
|
||||
|
||||
const util = isElectron() ? window.api.utils : null;
|
||||
|
||||
export type SongPathProps = {
|
||||
path: string | null;
|
||||
path: null | string;
|
||||
};
|
||||
|
||||
const PathText = styled.div`
|
||||
|
|
@ -28,11 +29,13 @@ export const SongPath = ({ path }: SongPathProps) => {
|
|||
>
|
||||
{({ copied, copy }) => (
|
||||
<Tooltip
|
||||
withinPortal
|
||||
label={t(
|
||||
copied ? 'page.itemDetail.copiedPath' : 'page.itemDetail.copyPath',
|
||||
{ postProcess: 'sentenceCase' },
|
||||
{
|
||||
postProcess: 'sentenceCase',
|
||||
},
|
||||
)}
|
||||
withinPortal
|
||||
>
|
||||
<ActionIcon onClick={copy}>
|
||||
{copied ? <RiCheckFill /> : <RiClipboardFill />}
|
||||
|
|
@ -42,8 +45,8 @@ export const SongPath = ({ path }: SongPathProps) => {
|
|||
</CopyButton>
|
||||
{util && (
|
||||
<Tooltip
|
||||
withinPortal
|
||||
label={t('page.itemDetail.openFile', { postProcess: 'sentenceCase' })}
|
||||
withinPortal
|
||||
>
|
||||
<ActionIcon>
|
||||
<RiExternalLinkFill
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue