forked from github/plane
380b00c1a2
* fix: upgrading next package and removed unused deps * chore: unused variable removed * chore: next image icon fix * chore: unused component removed * chore: next image icon fix * chore: replace use-debounce with lodash debounce * chore: unused component removed * resolved: fixed issue with next link component * fix: updates in next config * fix: updating types pages --------- Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@plane.so>
37 lines
1.3 KiB
TypeScript
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 hover:bg-custom-background-90 border-b border-custom-border-200">
|
|
<Link href={`/${workspaceSlug}/workspace-views/${view.key}`}>
|
|
<span className="flex items-center justify-between relative rounded px-5 py-4 w-full">
|
|
<div className="flex items-center justify-between w-full">
|
|
<div className="flex items-center gap-4">
|
|
<div className="grid place-items-center h-10 w-10 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 leading-4 font-medium">{truncateText(view.label, 75)}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</span>
|
|
</Link>
|
|
</div>
|
|
);
|
|
});
|