Repository: spotify/backstage
File: plugins/notifications/src/components/NotificationsPage/NotificationsPage.tsx (TypeScript)

Code before:
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { useState, useMemo, useEffect } from 'react';
import throttle from 'lodash/throttle';
import {
  Content,
  PageWithHeader,
  ResponseErrorPanel,
} from '@backstage/core-components';
import Grid from '@material-ui/core/Grid';
import { ConfirmProvider } from 'material-ui-confirm';
import { useSignal } from '@backstage/plugin-signals-react';
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
import { notificationsTranslationRef } from '../../translation';

const TableTitleKeys = {
  all: 'notificationsPage.tableTitle.all' as const,
  saved: 'notificationsPage.tableTitle.saved' as const,
  unread: 'notificationsPage.tableTitle.unread' as const,
  read: 'notificationsPage.tableTitle.read' as const,
} as const;

import { NotificationsTable } from '../NotificationsTable';
import { useNotificationsApi } from '../../hooks';
import {
  CreatedAfterOptions,
  NotificationsFilters,
  SortBy,
  SortByOptions,
} from '../NotificationsFilters';
import {
  GetNotificationsOptions,
  GetNotificationsResponse,
  GetTopicsResponse,
} from '../../api';
import {
  NotificationSeverity,
  NotificationStatus,
} from '@backstage/plugin-notifications-common';

const ThrottleDelayMs = 2000;

/** @public */
export type NotificationsPageProps = {
  /** Mark notification as read when opening the link it contains, defaults to false */
  markAsReadOnLinkOpen?: boolean;
  title?: string;

Review comment (suggestion):
```suggestion
const TableTitleKeys = {
  all: 'notificationsPage.tableTitle.all' ,
  saved: 'notificationsPage.tableTitle.saved' ,
  unread: 'notificationsPage.tableTitle.unread' ,
  read: 'notificationsPage.tableTitle.read' ,
} as const;

```
@ciiay I just want to check if we can remove `as const` from each entries.

Code after:
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { useEffect, useMemo, useState } from 'react';
import throttle from 'lodash/throttle';
import {
  Content,
  PageWithHeader,
  ResponseErrorPanel,
} from '@backstage/core-components';
import Grid from '@material-ui/core/Grid';
import { ConfirmProvider } from 'material-ui-confirm';
import { useSignal } from '@backstage/plugin-signals-react';
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
import { notificationsTranslationRef } from '../../translation';

const TableTitleKeys = {
  all: 'notificationsPage.tableTitle.all',
  saved: 'notificationsPage.tableTitle.saved',
  unread: 'notificationsPage.tableTitle.unread',
  read: 'notificationsPage.tableTitle.read',
} as const;

import { NotificationsTable } from '../NotificationsTable';
import { useNotificationsApi } from '../../hooks';
import {
  CreatedAfterOptions,
  NotificationsFilters,
  SortBy,
  SortByOptions,
} from '../NotificationsFilters';
import {
  GetNotificationsOptions,
  GetNotificationsResponse,
  GetTopicsResponse,
} from '../../api';
import {
  NotificationSeverity,
  NotificationStatus,
} from '@backstage/plugin-notifications-common';

const ThrottleDelayMs = 2000;

/** @public */
export type NotificationsPageProps = {
  /** Mark notification as read when opening the link it contains, defaults to false */
  markAsReadOnLinkOpen?: boolean;
  title?: string;