Files
animethemes-web/src/components/toast/PlaylistTrackRemoveToast.tsx
T
Mani b0724e568a chore: Bumped most of the dependencies to the latest version (#229)
* 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.
2025-01-19 02:46:18 +01:00

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
}
}
}
`,
};