Add missing cancel button & separators to dialog

This commit is contained in:
0x464e 2026-03-20 18:44:49 +02:00
parent 5dad8cfb2d
commit a0956ebe0f
No known key found for this signature in database
GPG Key ID: E6D221DF6CBFBFFA

View File

@ -15,6 +15,7 @@ import {
PopoverTrigger, PopoverTrigger,
} from "@/components/ui/popover"; } from "@/components/ui/popover";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { SelectSeparator } from "@/components/ui/select";
import { useFormattedTimestamp } from "@/hooks/use-date-utils"; import { useFormattedTimestamp } from "@/hooks/use-date-utils";
import { FrigateConfig } from "@/types/frigateConfig"; import { FrigateConfig } from "@/types/frigateConfig";
import { getUTCOffset } from "@/utils/dateUtil"; import { getUTCOffset } from "@/utils/dateUtil";
@ -73,6 +74,7 @@ export default function ShareTimestampDialog({
onShareTimestamp(timestamp); onShareTimestamp(timestamp);
onOpenChange(false); onOpenChange(false);
}} }}
onCancel={() => onOpenChange(false)}
/> />
); );
@ -146,6 +148,8 @@ export function ShareTimestampContent({
</div> </div>
</div> </div>
{isDesktop && <SelectSeparator className="my-4 bg-secondary" />}
<RadioGroup <RadioGroup
className="mt-4 flex flex-col gap-4" className="mt-4 flex flex-col gap-4"
value={selectedOption} value={selectedOption}
@ -197,18 +201,19 @@ export function ShareTimestampContent({
</div> </div>
</RadioGroup> </RadioGroup>
{isDesktop && <SelectSeparator className="my-4 bg-secondary" />}
<DialogFooter <DialogFooter
className={isDesktop ? "mt-4" : "mt-4 flex flex-col-reverse gap-4"} className={isDesktop ? "mt-4" : "mt-4 flex flex-col-reverse gap-4"}
> >
{onCancel && ( {onCancel && (
<Button <button
className={isDesktop ? "p-2" : "w-full"} type="button"
variant="ghost" className={`cursor-pointer p-2 text-center ${isDesktop ? "" : "w-full"}`}
size="sm"
onClick={onCancel} onClick={onCancel}
> >
{t("button.cancel", { ns: "common" })} {t("button.cancel", { ns: "common" })}
</Button> </button>
)} )}
<Button <Button
className={isDesktop ? "" : "w-full"} className={isDesktop ? "" : "w-full"}