mirror of
https://github.com/AnimeThemes/animethemes-web.git
synced 2026-07-11 01:24:31 +02:00
b0724e568a
* Bumped Next.js to 15. * Bumped React to 19. * Bumped GraphQL to 16. * Bumped styled-components to 6. * Bumped Radix components to latest version. * Migrated Framer Motion to new package. * Migrated react-query to new package. * Lots of TypeScript fixes. * Removed FontAwesome Pro icons. * Started fading out SWR. * Dev Server now uses Turbopack.
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import Link from "next/link";
|
|
|
|
import gql from "graphql-tag";
|
|
|
|
import { Row } from "@/components/box/Flex";
|
|
import { Text } from "@/components/text/Text";
|
|
import { Toast } from "@/components/toast/Toast";
|
|
import { SongTitle } from "@/components/utils/SongTitle";
|
|
import type {
|
|
PlaylistTrackRemoveToastEntryFragment,
|
|
PlaylistTrackRemoveToastPlaylistFragment,
|
|
} from "@/generated/graphql";
|
|
|
|
interface PlaylistTrackRemoveToastProps {
|
|
playlist: PlaylistTrackRemoveToastPlaylistFragment;
|
|
entry: PlaylistTrackRemoveToastEntryFragment;
|
|
}
|
|
|
|
export function PlaylistTrackRemoveToast({ playlist, entry }: PlaylistTrackRemoveToastProps) {
|
|
return (
|
|
<Toast as={Link} href={`/playlist/${playlist.id}`} $hoverable>
|
|
<Row $wrap style={{ "--justify-content": "space-between", "--gap": "8px" }}>
|
|
<span>
|
|
<SongTitle song={entry.theme?.song ?? null} /> was removed from{" "}
|
|
<Text color="text-primary">{playlist.name}</Text>!
|
|
</span>
|
|
<Text color="text-disabled">(Click to view playlist.)</Text>
|
|
</Row>
|
|
</Toast>
|
|
);
|
|
}
|
|
|
|
PlaylistTrackRemoveToast.fragments = {
|
|
playlist: gql`
|
|
fragment PlaylistTrackRemoveToastPlaylist on Playlist {
|
|
id
|
|
name
|
|
}
|
|
`,
|
|
entry: gql`
|
|
${SongTitle.fragments.song}
|
|
|
|
fragment PlaylistTrackRemoveToastEntry on Entry {
|
|
theme {
|
|
song {
|
|
...SongTitleSong
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
};
|