2022-11-24 09:41:03 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import ArrowDownward from '@mui/icons-material/ArrowDownward';
|
|
|
|
|
import ArrowUpward from '@mui/icons-material/ArrowUpward';
|
2023-08-14 21:43:06 +02:00
|
|
|
import { memo } from 'react';
|
2023-06-05 01:42:39 +02:00
|
|
|
import RadioInput, { RadioInputProps } from '@/components/atoms/RadioInput';
|
2022-11-24 09:41:03 +01:00
|
|
|
|
|
|
|
|
interface IProps extends RadioInputProps {
|
2023-02-06 10:06:33 +01:00
|
|
|
sortDescending?: boolean | null | undefined;
|
2022-11-24 09:41:03 +01:00
|
|
|
}
|
|
|
|
|
|
2023-08-14 21:43:06 +02:00
|
|
|
const SortRadioInput = memo(({ sortDescending, ...rest }: IProps) => (
|
2022-11-24 09:41:03 +01:00
|
|
|
<RadioInput
|
2023-02-08 18:19:26 +01:00
|
|
|
checkedIcon={sortDescending ? <ArrowDownward color="primary" /> : <ArrowUpward color="primary" />}
|
2022-11-24 09:41:03 +01:00
|
|
|
{...rest}
|
|
|
|
|
/>
|
2023-03-11 18:05:58 +01:00
|
|
|
));
|
2022-11-24 09:41:03 +01:00
|
|
|
|
|
|
|
|
export default SortRadioInput;
|