plane/web/components/workspace/views/default-view-list-item.tsx
sriram veeraghanta 8d15b9e7de
chore: format all files in monorepo (#3054)
* chore: format all files in the project

* fix: removing @types/react from dependencies

* fix: adding prettier and eslint config

* chore: format files

* fix: upgrading turbo version

* chore: ignoring warnings and adding todos

* fix: updated the type of bubble menu item in the document editor

* chore: format files

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
2023-12-10 15:48:10 +05:30

37 lines
1.3 KiB
TypeScript

import { useRouter } from "next/router";
import Link from "next/link";
import { observer } from "mobx-react-lite";
// icons
import { Sparkles } from "lucide-react";
// helpers
import { truncateText } from "helpers/string.helper";
type Props = { view: { key: string; label: string } };
export const GlobalDefaultViewListItem: React.FC<Props> = observer((props) => {
const { view } = props;
const router = useRouter();
const { workspaceSlug } = router.query;
return (
<div className="group border-b border-custom-border-200 hover:bg-custom-background-90">
<Link href={`/${workspaceSlug}/workspace-views/${view.key}`}>
<div className="relative flex w-full items-center justify-between rounded px-5 py-4">
<div className="flex w-full items-center justify-between">
<div className="flex items-center gap-4">
<div className="grid h-10 w-10 place-items-center rounded bg-custom-background-90 group-hover:bg-custom-background-100">
<Sparkles size={14} strokeWidth={2} />
</div>
<div className="flex flex-col">
<p className="truncate text-sm font-medium leading-4">{truncateText(view.label, 75)}</p>
</div>
</div>
</div>
</div>
</Link>
</div>
);
});