refactoring

This commit is contained in:
2025-11-10 15:43:26 +01:00
parent ce4ff192cb
commit c2710f0a67
3 changed files with 5 additions and 24 deletions

View File

@@ -254,7 +254,6 @@ const DashboardView = ({
: null;
const rangeStart = normalizedRange?.start || '';
const rangeEnd = normalizedRange?.end || '';
const hasDateRange = Boolean(rangeStart || rangeEnd);
return (
<tr
key={item.id || index}
@@ -294,7 +293,6 @@ const DashboardView = ({
value={item.desiredWeekday || ''}
onChange={(event) => onWeekdayChange(item.id, event.target.value)}
className="border rounded p-1 w-full"
disabled={hasDateRange}
>
<option value="">Kein Wochentag</option>
{weekdays.map((day) => (
@@ -307,18 +305,8 @@ const DashboardView = ({
<td className="px-4 py-2">
<button
type="button"
onClick={() => {
if (item.desiredWeekday) {
return;
}
onRangePickerRequest(item.id);
}}
disabled={Boolean(item.desiredWeekday)}
className={`w-full border rounded p-2 text-left transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${
item.desiredWeekday
? 'bg-gray-100 text-gray-400 cursor-not-allowed'
: 'bg-white hover:border-blue-400'
}`}
onClick={() => onRangePickerRequest(item.id)}
className="w-full border rounded p-2 text-left transition focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white hover:border-blue-400"
>
<span className="block text-sm text-gray-700">{formatRangeLabel(rangeStart, rangeEnd)}</span>
<span className="block text-xs text-gray-500">Klicke zum Auswählen</span>

View File

@@ -3,7 +3,7 @@ import { de } from 'date-fns/locale';
import { buildSelectionRange } from '../utils/dateUtils';
const RangePickerModal = ({ entry, minDate, onSelectRange, onResetRange, onClose }) => {
if (!entry || entry.desiredWeekday) {
if (!entry) {
return null;
}