mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-01 01:18:10 +02:00
* feat: upgrade search to use the new search component (#1073) * feat: upgrade project list search to use the new search field * cleanup unused imports * feat: add upgraded search to projects and applications, polish search UX * refactor: TableSearch to new Search common component Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com> * fix: resolve issues with project edit/delete button conditions (#1084) * fix: fix UPDATE_PROJECT permission checks for editors * fix: disable delete button for the default project * fix: warn about access on edit project page * fix: hide broken project edit/delete buttons for OSS * refactor: avoid project card clicks when closing modals * refactor: improve default project deletion message * refactor: improve project access error text * Update src/component/project/ProjectCard/ProjectCard.tsx Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * refactor: fix string quotes * refactor: improve disabled menu item contrast * refactor: remove Enterprise routes for OSS Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * fix: archive table small adjustments * refactor archive table params Co-authored-by: Nuno Góis <github@nunogois.com> Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com> Co-authored-by: olav <mail@olav.io> Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { VFC } from 'react';
|
|
import TimeAgo from 'react-timeago';
|
|
import { Tooltip, Typography } from '@mui/material';
|
|
import { formatDateYMD } from 'utils/formatDate';
|
|
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
|
import { useLocationSettings } from 'hooks/useLocationSettings';
|
|
|
|
interface IFeatureArchivedCellProps {
|
|
value?: string | Date | null;
|
|
}
|
|
|
|
export const FeatureArchivedCell: VFC<IFeatureArchivedCellProps> = ({
|
|
value: archivedAt,
|
|
}) => {
|
|
const { locationSettings } = useLocationSettings();
|
|
|
|
if (!archivedAt) return <TextCell />;
|
|
|
|
return (
|
|
<TextCell>
|
|
{archivedAt && (
|
|
<Tooltip
|
|
title={`Archived on: ${formatDateYMD(
|
|
archivedAt,
|
|
locationSettings.locale
|
|
)}`}
|
|
arrow
|
|
>
|
|
<Typography noWrap variant="body2" data-loading>
|
|
<TimeAgo date={new Date(archivedAt)} />
|
|
</Typography>
|
|
</Tooltip>
|
|
)}
|
|
</TextCell>
|
|
);
|
|
};
|