plane/web/components/view/display-properties/root.tsx

51 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-02-09 09:03:22 +00:00
import { FC, Fragment } from "react";
import { observer } from "mobx-react-lite";
// components
import { ViewDisplayPropertySelection } from "../";
// types
import { TViewDisplayProperties, TViewTypes } from "@plane/types";
import { TViewOperations } from "../types";
2024-02-02 08:22:38 +00:00
type TViewDisplayPropertiesRoot = {
workspaceSlug: string;
projectId: string | undefined;
viewId: string;
viewType: TViewTypes;
viewOperations: TViewOperations;
2024-02-02 08:22:38 +00:00
};
2024-02-09 09:03:22 +00:00
export const ViewDisplayPropertiesRoot: FC<TViewDisplayPropertiesRoot> = observer((props) => {
const { workspaceSlug, projectId, viewId, viewType, viewOperations } = props;
const displayProperties: Partial<keyof TViewDisplayProperties>[] = [
"key",
"state",
"labels",
"priority",
"assignee",
"start_date",
"due_date",
"sub_issue_count",
"attachment_count",
"estimate",
"link",
];
2024-02-02 08:22:38 +00:00
return (
<div className="relative flex items-center flex-wrap gap-2">
{displayProperties.map((property) => (
2024-02-09 09:03:22 +00:00
<Fragment key={property}>
<ViewDisplayPropertySelection
workspaceSlug={workspaceSlug}
projectId={projectId}
viewId={viewId}
viewType={viewType}
viewOperations={viewOperations}
property={property}
/>
</Fragment>
))}
2024-02-02 08:22:38 +00:00
</div>
);
2024-02-09 09:03:22 +00:00
});