upd: dokumen divisi
Deskripsi: - move dokumen divisi - copy dokumen divisi - share dokumen divisi NO issues
This commit is contained in:
@@ -13,6 +13,7 @@ type Props = {
|
||||
close: (value: boolean) => void
|
||||
category: 'copy' | 'move'
|
||||
onConfirm: (value: string) => void
|
||||
dataChoose: any[]
|
||||
}
|
||||
|
||||
type DataProps = {
|
||||
@@ -33,7 +34,7 @@ type PropsPath = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default function ModalSalinMove({ open, close, category, onConfirm }: Props) {
|
||||
export default function ModalSalinMove({ open, close, category, onConfirm, dataChoose }: Props) {
|
||||
const [data, setData] = useState<DataProps[]>([])
|
||||
const { token, decryptToken } = useAuthSession()
|
||||
const [path, setPath] = useState('home')
|
||||
@@ -79,18 +80,28 @@ export default function ModalSalinMove({ open, close, category, onConfirm }: Pro
|
||||
</View>
|
||||
<View>
|
||||
{
|
||||
data.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType="bottom"
|
||||
icon={<Ionicons name="folder-open-sharp" color={'#f9cc40'} size={30} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
onPress={() => {
|
||||
setPath(item.id);
|
||||
}}
|
||||
/>
|
||||
))
|
||||
data.length > 0 ?
|
||||
data.map((item, index) => {
|
||||
const found = dataChoose.some((i: any) => i.id == item.id);
|
||||
return (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType="bottom"
|
||||
icon={<Ionicons name="folder-open-sharp" style={[found ? Styles.cGray : Styles.cFolder]} size={30} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
onPress={() => {
|
||||
if (found) return;
|
||||
setPath(item.id);
|
||||
}}
|
||||
subtitle={found ? <Text style={[Styles.textInformation, Styles.cGray]}>Tidak dapat memilih folder ini</Text> : ''}
|
||||
/>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
:
|
||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.mt15, { textAlign: 'center' }]}>Tidak ada data</Text>
|
||||
}
|
||||
</View>
|
||||
<View style={[Styles.rowOnly, Styles.mt15, Styles.absolute0]}>
|
||||
|
||||
Reference in New Issue
Block a user