mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
20 lines
571 B
TypeScript
20 lines
571 B
TypeScript
import type { BoardId } from 'features/gallery/store/types';
|
|
import { t } from 'i18next';
|
|
import { useListAllBoardsQuery } from 'services/api/endpoints/boards';
|
|
|
|
export const useBoardName = (board_id: BoardId) => {
|
|
const { boardName } = useListAllBoardsQuery(
|
|
{ include_archived: true },
|
|
{
|
|
selectFromResult: ({ data }) => {
|
|
const selectedBoard = data?.find((b) => b.board_id === board_id);
|
|
const boardName = selectedBoard?.board_name || t('boards.uncategorized');
|
|
|
|
return { boardName };
|
|
},
|
|
}
|
|
);
|
|
|
|
return boardName;
|
|
};
|