Skip to content

Commit

Permalink
fix: update lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala committed Sep 17, 2024
1 parent abf5bc9 commit ff5eb34
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/app/production/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,7 @@ export default function ProductionConfiguration({ params }: PageProps) {
</div>
{productionSetup && productionSetup.isActive && (
<div className="flex justify-end p-3">
<MonitoringButton
id={productionSetup?._id.toString()}
locked={locked}
/>
<MonitoringButton id={productionSetup?._id.toString()} />
</div>
)}
</div>
Expand Down
11 changes: 2 additions & 9 deletions src/components/button/MonitoringButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ import { useTranslate } from '../../i18n/useTranslate';
import { useMonitoringError } from '../../hooks/monitoring';
import { IconLoader } from '@tabler/icons-react';
import { IconAlertTriangleFilled } from '@tabler/icons-react';

type MonitoringButtonProps = {
id: string;
locked: boolean;
};

export const MonitoringButton = ({ id, locked }: MonitoringButtonProps) => {
export const MonitoringButton = ({ id }: MonitoringButtonProps) => {
const t = useTranslate();
const [hasError, loading] = useMonitoringError(id);

return (
<Link
className={`${
locked
? 'bg-button-bg/50 pointer-events-none text-p/50'
: 'pointer-events-auto'
} ${
hasError && !locked
hasError
? 'bg-button-delete hover:bg-button-delete '
: 'bg-button-bg hover:bg-button-hover-bg'
} text-button-text font-bold px-4 py-2 rounded inline-flex items-center justify-center`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/productionsList/ProductionsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function ProductionsListItem({
</Link>
<div className="flex space-x-4">
{production.isActive && (
<MonitoringButton id={production._id.toString()} locked={locked} />
<MonitoringButton id={production._id.toString()} />
)}
{isConfigured(production) && (
<div
Expand Down

0 comments on commit ff5eb34

Please sign in to comment.