33 Copyright (c) 2015-2026 Lablup Inc. All rights reserved.
44 */
55import BAINotificationBackgroundProgress from './BAINotificationBackgroundProgress' ;
6+ import { useFolderExplorerOpener } from './FolderExplorerOpener' ;
67import { useToggle } from 'ahooks' ;
78import { Card , List , theme , Typography } from 'antd' ;
89import {
@@ -16,16 +17,15 @@ import dayjs from 'dayjs';
1617import * as _ from 'lodash-es' ;
1718import { useTranslation } from 'react-i18next' ;
1819import { graphql , useFragment } from 'react-relay' ;
19- import { BAIVFolderNotificationItemFragment$key } from 'src/__generated__/BAIVFolderNotificationItemFragment.graphql' ;
20- import { useWebUINavigate } from 'src/hooks' ;
20+ import { BAIVirtualFolderNodeNotificationItemV2Fragment$key } from 'src/__generated__/BAIVirtualFolderNodeNotificationItemV2Fragment.graphql' ;
2121import {
2222 NotificationState ,
2323 useSetBAINotification ,
2424} from 'src/hooks/useBAINotification' ;
2525
26- interface BAIVFolderNotificationItemProps {
26+ interface BAIVirtualFolderNodeNotificationItemV2Props {
2727 notification : NotificationState ;
28- vfolderFrgmt : BAIVFolderNotificationItemFragment $key | null ;
28+ vfolderFrgmt : BAIVirtualFolderNodeNotificationItemV2Fragment $key | null ;
2929 showDate ?: boolean ;
3030}
3131
@@ -34,14 +34,12 @@ interface BAIVFolderNotificationItemProps {
3434// list/mutation flows can pass `node: vfolder` to `upsertNotification` and
3535// get the same rich folder-link + extra-description rendering as the legacy
3636// V1 path. The V1 component stays in place until all callers migrate.
37- const BAIVFolderNotificationItem : React . FC < BAIVFolderNotificationItemProps > = ( {
38- notification,
39- vfolderFrgmt,
40- showDate,
41- } ) => {
37+ const BAIVirtualFolderNodeNotificationItemV2 : React . FC <
38+ BAIVirtualFolderNodeNotificationItemV2Props
39+ > = ( { notification, vfolderFrgmt, showDate } ) => {
4240 'use memo' ;
4341
44- const navigate = useWebUINavigate ( ) ;
42+ const { open : openFolderExplorer } = useFolderExplorerOpener ( ) ;
4543 const { t } = useTranslation ( ) ;
4644 const { token } = theme . useToken ( ) ;
4745 const { closeNotification } = useSetBAINotification ( ) ;
@@ -50,7 +48,7 @@ const BAIVFolderNotificationItem: React.FC<BAIVFolderNotificationItemProps> = ({
5048
5149 const node = useFragment (
5250 graphql `
53- fragment BAIVFolderNotificationItemFragment on VFolder {
51+ fragment BAIVirtualFolderNodeNotificationItemV2Fragment on VFolder {
5452 id
5553 metadata {
5654 name
@@ -76,9 +74,9 @@ const BAIVFolderNotificationItem: React.FC<BAIVFolderNotificationItemProps> = ({
7674 } }
7775 title = { folderName || '' }
7876 onClick = { ( ) => {
79- navigate (
80- `/data ${ localId ? `? ${ new URLSearchParams ( { folder : localId } ) . toString ( ) } ` : '' } ` ,
81- ) ;
77+ if ( localId ) {
78+ openFolderExplorer ( localId ) ;
79+ }
8280 closeNotification ( notification . key ) ;
8381 } }
8482 >
@@ -148,4 +146,4 @@ const BAIVFolderNotificationItem: React.FC<BAIVFolderNotificationItemProps> = ({
148146 ) ;
149147} ;
150148
151- export default BAIVFolderNotificationItem ;
149+ export default BAIVirtualFolderNodeNotificationItemV2 ;
0 commit comments